Hi everyone. I wonder how to pass partition start ...
# ask-community
s
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
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}")