Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openlineage: replace dt.now with airflow.utils.timezone.utcnow #40887

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

kacpermuda
Copy link
Contributor

Fix missing timezone information in task FAIL event.

Related: OpenLineage/OpenLineage#2858


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

Signed-off-by: Kacper Muda <mudakacper@gmail.com>
@rahul-madaan
Copy link
Contributor

rahul-madaan commented Jul 19, 2024

Just want to make sure, does this change also update the time format in DAG FAIL event?

@kacpermuda
Copy link
Contributor Author

Just want to make sure, does this change also update the time format in DAG FAIL event?

Not sure i understand what you mean by time format, but now we should receive a proper isoformat with timezone information, like 2024-07-19T11:37:47.999954+00:00 in all events. The on_task_instance_failed is actually the only place where we use that else clause, as the task_instance.end_date is missing, so it's the only place where we are not using airflow provided timestamps and create them ourselves - that's why timezone was missing, we did not make this timestamp timezone aware.

@rahul-madaan
Copy link
Contributor

Yes got it. only the task FAIL was missing timezone info. DAG FAIL already has the timezone. Thanks for confirming :)

@kacpermuda
Copy link
Contributor Author

Yes got it. only the task FAIL was missing timezone info. DAG FAIL already has the timezone. Thanks for confirming :)

Ah, yes, now i saw that you mean the DAG 😄 Yes, DAG FAIL always has the timezone, it's handled internally in Airflow and we do not touch it. Now all events should have a consistent format.

@mobuchowski mobuchowski merged commit 12e17d1 into apache:main Jul 22, 2024
52 checks passed
@kacpermuda kacpermuda deleted the ol-fix-dt-now branch July 22, 2024 10:04
romsharon98 pushed a commit to romsharon98/airflow that referenced this pull request Jul 26, 2024
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