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

Son Giang

04/22/2022, 4:07 AM
Hi everyone. I wonder how to pass partition start and end to every ops in a graph/job? Like do we have some sort of global context for a graph/job so we can use for the ops when needed? It’s such a pain when I have to pass partition information (start/end time) to every ops.
p

prha

04/22/2022, 4:52 AM
You should also be able to access
partition_key
off of the context, if the op is a partitioned job.
Copy code
@op
def my_op(context):
    if context.has_partition_key:
        <http://context.log.info|context.log.info>(f"this job run has partition key {context.partition_key}")