I’m looking for docs on defining graphs with Pytho...
# ask-community
t
I’m looking for docs on defining graphs with Python code like
Copy code
@graph(...)
def my_graph(...):
  # what Python is allowed/unsupported in these graph impls?
the only examples I can find in the docs are trivial besides DynamicOutput.map/collect, so I’m wondering if there are more details somewhere.
for example, are conditionals allowed? can I just write an
if
statement?
j
Hi Taylor, inside a graph is the dsl for hooking together ops- mostly it’s just function composition. You can’t (currently) use an
if
inside a graph- instead you would use conditional outputs that cause a downstream step to skip. https://docs.dagster.io/concepts/ops-jobs-graphs/jobs-graphs#conditional-branching
t
thanks!