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

[AIRFLOW-7001] Further fix for the MySQL 5.7 UtcDateTime #7655

Conversation

potiuk
Copy link
Member

@potiuk potiuk commented Mar 8, 2020

The original fix from the commit
b4215f6 

was wrong. It converted to utc initially but then make_naive
had used TIMEZONE and converted it to the lcoal timezone rather
than UTC.


Issue link: AIRFLOW-7001

Make sure to mark the boxes below before creating PR: [x]

  • Description above provides context of the change
  • Commit message/PR title starts with [AIRFLOW-NNNN]. AIRFLOW-NNNN = JIRA ID*
  • Unit tests coverage for changes (not needed for documentation changes)
  • Commits follow "How to write a good git commit message"
  • Relevant documentation is updated including usage instructions.
  • I will engage committers as explained in Contribution Workflow Example.

* For document-only changes commit message can start with [AIRFLOW-XXXX].


In case of fundamental code change, 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 UPDATING.md.
Read the Pull Request Guidelines for more information.

@potiuk potiuk requested review from ashb, kaxil and turbaszek March 8, 2020 10:55
@potiuk
Copy link
Member Author

potiuk commented Mar 8, 2020

Hey @nuclearpinguin -> I realized my original fix was wrong :( This one should work as intended.

@potiuk
Copy link
Member Author

potiuk commented Mar 8, 2020

@anitakar -> happy if you review this one as well :)

@anitakar
Copy link
Contributor

anitakar commented Mar 8, 2020

@anitakar -> happy if you review this one as well :)

Sure. But maybe around 18:00 Warsaw time

@potiuk potiuk force-pushed the AIRFLOW-7001-fix-mysql-timezone-problem-correction branch from 52be607 to c6e5bff Compare March 8, 2020 16:12
@codecov-io
Copy link

codecov-io commented Mar 8, 2020

Codecov Report

Merging #7655 into master will decrease coverage by 0.27%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7655      +/-   ##
==========================================
- Coverage   86.82%   86.55%   -0.28%     
==========================================
  Files         897      897              
  Lines       42869    42869              
==========================================
- Hits        37223    37104     -119     
- Misses       5646     5765     +119
Impacted Files Coverage Δ
airflow/utils/sqlalchemy.py 85.71% <100%> (ø) ⬆️
airflow/kubernetes/volume_mount.py 44.44% <0%> (-55.56%) ⬇️
airflow/kubernetes/volume.py 52.94% <0%> (-47.06%) ⬇️
airflow/kubernetes/pod_launcher.py 47.18% <0%> (-45.08%) ⬇️
...viders/cncf/kubernetes/operators/kubernetes_pod.py 69.69% <0%> (-25.26%) ⬇️
airflow/kubernetes/refresh_config.py 50.98% <0%> (-23.53%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 29e848d...65fd203. Read the comment docs.

@potiuk
Copy link
Member Author

potiuk commented Mar 8, 2020

It's green and small !

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Worth adding tests for this? Especially to test what behaviour this has when given dts in other timezones

@potiuk
Copy link
Member Author

potiuk commented Mar 8, 2020

Worth adding tests for this? Especially to test what behaviour this has when given dts in other timezones

True. Will take a look at this!

@anitakar
Copy link
Contributor

anitakar commented Mar 8, 2020

LGTM

@potiuk potiuk force-pushed the AIRFLOW-7001-fix-mysql-timezone-problem-correction branch from c6e5bff to e233daf Compare March 9, 2020 08:59
@potiuk
Copy link
Member Author

potiuk commented Mar 9, 2020

@anitakar @ashb -> tests added

@potiuk potiuk force-pushed the AIRFLOW-7001-fix-mysql-timezone-problem-correction branch from e233daf to 3aa874e Compare March 9, 2020 10:41
Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Couple of comments/optional, and one change to rename the fixture fn to avoid the redefined-outer-name lint warning.

tests/models/test_timestamp.py Outdated Show resolved Hide resolved
tests/models/test_timestamp.py Outdated Show resolved Hide resolved
tests/models/test_timestamp.py Outdated Show resolved Hide resolved
tests/models/test_timestamp.py Show resolved Hide resolved
@potiuk potiuk force-pushed the AIRFLOW-7001-fix-mysql-timezone-problem-correction branch from 3aa874e to 14ad1c9 Compare March 9, 2020 18:13
The original fix from the commit
b4215f6 

was wrong. It converted to utc initially but then make_naive
had used TIMEZONE and converted it to the lcoal timezone rather
than UTC.
@potiuk potiuk force-pushed the AIRFLOW-7001-fix-mysql-timezone-problem-correction branch from 14ad1c9 to 65fd203 Compare March 9, 2020 18:16
@potiuk
Copy link
Member Author

potiuk commented Mar 9, 2020

All fixed @ashb !

@potiuk
Copy link
Member Author

potiuk commented Mar 12, 2020

Hey @ashb -> would love to merge it. Then I could also switch to 5.7 in tests #7570

@potiuk
Copy link
Member Author

potiuk commented Mar 13, 2020

Gentle ping @ashb

Copy link
Member

@ashb ashb left a comment

Choose a reason for hiding this comment

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

Sorry I missed nthe earlier ping, have been struggling to keep on top of notifications

@potiuk potiuk merged commit 4e49f00 into apache:master Mar 13, 2020
kaxil pushed a commit that referenced this pull request Mar 23, 2020
The original fix from the commit
b4215f6 

was wrong. It converted to utc initially but then make_naive
had used TIMEZONE and converted it to the lcoal timezone rather
than UTC.

(cherry picked from commit 4e49f00)
kaxil pushed a commit that referenced this pull request Mar 30, 2020
The original fix from the commit
b4215f6 

was wrong. It converted to utc initially but then make_naive
had used TIMEZONE and converted it to the lcoal timezone rather
than UTC.

(cherry picked from commit 4e49f00)
kaxil pushed a commit to astronomer/airflow that referenced this pull request Mar 30, 2020
The original fix from the commit
b4215f6 

was wrong. It converted to utc initially but then make_naive
had used TIMEZONE and converted it to the lcoal timezone rather
than UTC.

(cherry picked from commit 4e49f00)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants