Description
Add asset partitioning's partition_key to airflow.sdk.definitions.context.Context.
Use case/motivation
In asset partitioning the partition key replaces the role of the data interval. While CronPartitionTimetable doesn't have a data interval anymore, users who instead want to work with the partition key need to access the partition key via the task's dagrun:
# current
ctx = get_current_context()
ctx["dag_run"].partition_key
instead of directly accessing it via the context:
# proposed
ctx = get_current_context()
ctx["partition_key"]
Related issues
No response
Are you willing to submit a PR?
Code of Conduct
Description
Add asset partitioning's
partition_keytoairflow.sdk.definitions.context.Context.Use case/motivation
In asset partitioning the partition key replaces the role of the data interval. While
CronPartitionTimetabledoesn't have a data interval anymore, users who instead want to work with the partition key need to access the partition key via the task's dagrun:instead of directly accessing it via the context:
Related issues
No response
Are you willing to submit a PR?
Code of Conduct