You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "bujjibabukatta (via GitHub)" <gi...@apache.org> on 2026/06/09 07:56:19 UTC
[PR] feat(models): expose partition_key and partition_date on TaskInstance [airflow]
bujjibabukatta opened a new pull request, #68276:
URL: https://github.com/apache/airflow/pull/68276
Add Asset partition attributes to TaskInstance
Fixes #68079, related to #68075.
What changed:
airflow-core/src/airflow/models/taskinstance.py — adds a partition_date property that parses partition_key (already proxied from dag_run) into a timezone-aware datetime, returning None for non-partitioned runs or unparseable keys.
airflow-core/src/airflow/utils/helpers.py — fixes log_filename_template_renderer in two ways:
Jinja branch now injects ts_nodash, ts, ts_nodash_with_tz, partition_key, and partition_date into the render context instead of returning a bare Template.render with no context.
f-string branch no longer crashes when logical_date is None (falls back to partition_date, then empty string).
Why: Asset-triggered DAGs using PartitionedAssetTimetable set logical_date=None, causing the scheduler to crash on ti.logical_date.isoformat() during log filename rendering. Users also had no way to reference partition attributes in templates at all.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(models): expose partition_key and partition_date on TaskInstance [airflow]
Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on PR #68276:
URL: https://github.com/apache/airflow/pull/68276#issuecomment-4665429149
@bujjibabukatta - I closed the issue as "not planned".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(models): expose partition_key and partition_date on TaskInstance [airflow]
Posted by "kaxil (via GitHub)" <gi...@apache.org>.
kaxil closed pull request #68276: feat(models): expose partition_key and partition_date on TaskInstance
URL: https://github.com/apache/airflow/pull/68276
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(models): expose partition_key and partition_date on TaskInstance [airflow]
Posted by "jroachgolf84 (via GitHub)" <gi...@apache.org>.
jroachgolf84 commented on PR #68276:
URL: https://github.com/apache/airflow/pull/68276#issuecomment-4673646000
@bujjibabukatta - I think it would make sense to close this PR, as I don't think the work is needed :)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org