Skip to content

Conversation

@AutomationDev85
Copy link
Contributor

Overview

This PR fixes the issue that it is not possible to set the task instance note field view the internal api. Without this the Edge worker is not able to update the note filed of the task_instance. To fix this the TaskInstancePydantic model was updated with the note field and the function which converts sets the ti attributes to convert pydantic into TaskInstance set the note field. This enables the Edge worker to set the note field of an task instance. This is pointing to only to the 2.10 test branch as the code will be complete change in Airflow 3.

Details of change:

  • Add note field to the TaskInstancePydantic class.
  • Allow _set_ti_attrs function to set the note field of the task instance.
  • Only relevant for the 2.10 versions.

@AutomationDev85 AutomationDev85 changed the title [Internal API] Fix issue that task instance note field not possible to set via the internal api. [Internal API][only 2.10] Fix issue that task instance note field not possible to set via the internal api. Mar 14, 2025
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a test case when the source is TaskInstancePydantic?

@jscheffl jscheffl added this to the Airflow 2.10.6 milestone Mar 16, 2025
@AutomationDev85 AutomationDev85 force-pushed the bugfix/allow-internal-api-to-update-note-field branch from 4d459f4 to 306b734 Compare March 18, 2025 10:57
Copy link
Contributor

@bugraoz93 bugraoz93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good to me! Thanks for the detailed description and including the tests!

@jscheffl
Copy link
Contributor

@AutomationDev85 Test looks good from code but fails in details. I suspect that in the setup of pytest you need to sync the mocked data to the DB before you run the test, else in the test execution the internal API backend can not find the mock data in DB.

@AutomationDev85 AutomationDev85 force-pushed the bugfix/allow-internal-api-to-update-note-field branch from 7e115da to 0a3b2fb Compare March 21, 2025 12:41
@AutomationDev85
Copy link
Contributor Author

@jscheffl Thanks for the tip. I changed the test case.

@jscheffl
Copy link
Contributor

Errors are un-related to this PR, therefore merging.

@jscheffl jscheffl merged commit a871ab3 into apache:v2-10-test Mar 21, 2025
40 of 42 checks passed
@kaxil kaxil modified the milestones: Airflow 2.10.6, Airflow 2.11.0 Apr 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants