Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[v3-1-test] Fix log task instance join (#59973)#60222

Merged
jscheffl merged 5 commits intoapache:v3-1-testfrom
Subham-KRLX:fix-backport-v3-1-test
Jan 7, 2026
Merged

[v3-1-test] Fix log task instance join (#59973)#60222
jscheffl merged 5 commits intoapache:v3-1-testfrom
Subham-KRLX:fix-backport-v3-1-test

Conversation

Copy link
Contributor

Subham-KRLX commented Jan 7, 2026 *
edited
Loading

Manual backport of logic from #59973 to v3-1-test.

The automated backport (#60208) failed because v3-1-test doesn't support the SQLAlchemy 2.0 Mapped type hints used in main.

This PR:

  • Applies the corrected join logic (dag_id, task_id, run_id, map_index).
  • Removes incompatible Mapped annotations in airflow/models/log.py to match the environment.
  • Flattens primaryjoin string for Ruff compatibility.

related: #59973
closes: #60208

Subham-KRLX and others added 2 commits January 7, 2026 11:06
* Fix incorrect Log and TaskInstance join query

* Fix log task instance join foreign keys and remove stray newsfragment

* Remove unused task variable assignments in test_log_task_instance_join_correctness

* Fix CI failures and address reviewer comments: revert unrelated doc changes, clean up tests, add Mapped type hints to Log relationships, and run ruff formatting

* Restore newsfragment and fix missing import in log.py

* Fix reviewer feedback: add license, move imports, and fix newsfragments

* Fix ruff static check failure in log.py

* Flatten primaryjoin definition to fix formatting

* Fix newsfragments per review: restore 58337 and remove 59965

* Remove unused import in log.py

---------
(cherry picked from commit 91af86e)

Co-authored-by: Subham
Co-authored-by: Jason(Zhe-You) Liu <68415893+jason810496@users.noreply.github.com>
boring-cyborg bot added the area:dev-tools label Jan 7, 2026
Subham-KRLX requested a review from ashb as a code owner January 7, 2026 15:28
boring-cyborg bot added area:production-image Production image improvements and fixes backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch labels Jan 7, 2026
Subham-KRLX requested review from XD-DENG, rawwar, romsharon98, ryanahamilton, sekikn, shahar1, shubhamraj-git and vatsrahul1001 as code owners January 7, 2026 15:29
Subham-KRLX closed this Jan 7, 2026
Subham-KRLX mentioned this pull request Jan 7, 2026
Subham-KRLX reopened this Jan 7, 2026
Subham-KRLX marked this pull request as draft January 7, 2026 15:39
Subham-KRLX changed the base branch from main to v3-1-test January 7, 2026 15:43
Subham-KRLX marked this pull request as ready for review January 7, 2026 15:44
potiuk changed the title Fix backport v3 1 test [v3-1-test] Fix log task instance join (#59973) Jan 7, 2026
Copy link
Contributor Author

Subham-KRLX commented Jan 7, 2026

I have pushed a fix for the static check failure (unused import in log.py).
The import from airflow.models.dag import DagModel was no longer needed after removing the Mapped type hints and has been removed.

potiuk reacted with thumbs up emoji

potiuk approved these changes Jan 7, 2026
potiuk reviewed Jan 7, 2026
jscheffl removed the backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch label Jan 7, 2026
jscheffl merged commit 562a463 into apache:v3-1-test Jan 7, 2026
63 checks passed
ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

potiuk potiuk approved these changes

ashb Awaiting requested review from ashb ashb is a code owner

amoghrajesh Awaiting requested review from amoghrajesh

kaxil Awaiting requested review from kaxil

ephraimbuddy Awaiting requested review from ephraimbuddy

bolkedebruin Awaiting requested review from bolkedebruin

gopidesupavan Awaiting requested review from gopidesupavan

jscheffl Awaiting requested review from jscheffl

bugraoz93 Awaiting requested review from bugraoz93

jason810496 Awaiting requested review from jason810496

dstandish Awaiting requested review from dstandish

jedcunningham Awaiting requested review from jedcunningham

pierrejeambrun Awaiting requested review from pierrejeambrun

bbovenzi Awaiting requested review from bbovenzi

hussein-awala Awaiting requested review from hussein-awala

mobuchowski Awaiting requested review from mobuchowski

dabla Awaiting requested review from dabla

vincbeck Awaiting requested review from vincbeck

josh-fell Awaiting requested review from josh-fell

Fokko Awaiting requested review from Fokko

o-nikolas Awaiting requested review from o-nikolas

uranusjr Awaiting requested review from uranusjr

Lee-W Awaiting requested review from Lee-W

guan404ming Awaiting requested review from guan404ming

BasPH Awaiting requested review from BasPH

sekikn Awaiting requested review from sekikn

vatsrahul1001 Awaiting requested review from vatsrahul1001

shahar1 Awaiting requested review from shahar1

romsharon98 Awaiting requested review from romsharon98

ryanahamilton Awaiting requested review from ryanahamilton

shubhamraj-git Awaiting requested review from shubhamraj-git

rawwar Awaiting requested review from rawwar

XD-DENG Awaiting requested review from XD-DENG XD-DENG is a code owner

Assignees

No one assigned

Labels

area:dev-tools area:production-image Production image improvements and fixes type:bug-fix Changelog: Bug Fixes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants