https://dagster.io/ logo
#ask-community
Title
# ask-community
t

Taylor Wood

06/09/2022, 2:40 PM
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

johann

06/09/2022, 3:44 PM
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

Taylor Wood

06/09/2022, 3:46 PM
thanks!
2 Views