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

Issue #407: Migrate to arrow 1.0.0 #408

Merged
merged 6 commits into from
Mar 4, 2021
Merged

Conversation

veganjay
Copy link
Contributor

@veganjay veganjay commented Mar 1, 2021

The arrow library moved to 1.0.0 on February 24, 2021 and with it came breaking changes.
This pull request addresses those changes per the arrow migration guide.

- requirements.txt: specify arrow==1.00
- frames.py, fullmoon.py, watson.py: change "timestamp" to
  "int_timestamp"
- cli.py: change "date.tzinfo = tz.tzlocal()" to "date.replace(tzinfo=tz.tzlocal())"
Copy link
Contributor

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

Looks like you'll have to also fix the tests... Thanks! 🙏

requirements.txt Outdated Show resolved Hide resolved
This makes sense, especially given that arrow is already up to 1.0.2

Co-authored-by: Julien Maupetit <[email protected]>
@veganjay
Copy link
Contributor Author

veganjay commented Mar 2, 2021

Looks like you'll have to also fix the tests... Thanks!

I took a quick look and there is an issue with timezone localization, making "add --from" and "add --to" work incorrectly. I need to investigate further.

@jmaupetit jmaupetit mentioned this pull request Mar 2, 2021
- watson.cli.py: use date = date.replace(tzinfo=tz.tzlocal())
  (date.replace does not modify the existing object)
Update unit test cases:

- tests/test_cli.py: replace arrow.arrow.datetime with arrow.arrow.dt_datetime
- tests/test_watson.py: replace .timestamp with .int_timestamp
@veganjay
Copy link
Contributor Author

veganjay commented Mar 3, 2021

I fixed the unit test cases and also another issue with the timezone. The proper way to change the timezone of an arrow date is now:

date = date.replace(tzinfo=tz.tzlocal())

The travis build failed because arrow 1.0.0 is not available for python 3.5.
Given that Python 3.5 is at end of life, it may be worthwhile considering ending support with updating setup.py and .travis.yml accordingly.

@jmaupetit
Copy link
Contributor

Thank you so much @veganjay 🙏

Given that Python 3.5 is at end of life, it may be worthwhile considering ending support with updating setup.py and .travis.yml accordingly.

Agreed! Can you add consequent changes in this PR & fill the CHANGELOG to mention arrow major release upgrade + dropped python 3.5 support? Thx ❤️

- .travis.yml: remove python 3.5
- setup.py: require python >= 3.6
- CHANGELOG.md: mention arrow upgrade and drop of python 3.5 support
@veganjay
Copy link
Contributor Author

veganjay commented Mar 4, 2021

Removed support for 3.5 and updated the CHANGELOG.

By the way, I installed td-watson with pipx:

pipx install td-watson

This way the arrow library and other dependencies are installed in their own isolated environment. This is helpful if working on various other virtualenvs during the day.

Copy link
Contributor

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

Thank you @veganjay 🙏 ❤️

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.

Breaking changes with arrow 1.0.0
2 participants