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

Add fold kwarg for arrow.get #1139

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nik-k11
Copy link

@nik-k11 nik-k11 commented Oct 28, 2022

Pull Request Checklist

Thank you for taking the time to improve Arrow! Before submitting your pull request, please check all appropriate boxes:

  • 🧪 Added tests for changed code.
  • 🛠️ All tests pass when run locally (run tox or make test to find out!).
  • 🧹 All linting checks pass when run locally (run tox -e lint or make lint to find out!).
  • 📚 Updated documentation for changed code.
  • ⏩ Code is up-to-date with the master branch.

If you have any questions about your code changes or any of the points above, please submit your questions along with the pull request and we will try our best to help!

Description of Changes

  • Add fold kwarg for arrow.get.
  • Remove getattr since Python 2.7/3.5 support is dropped.
  • Make fold a keyword-only argument for Arrow.__init__ per this discussion.

Also please note the fold documentation in ArrowFactory.get. Basically, I only relay the fold kwarg into Arrow.fromdatetime and Arrow.__init__ calls.

Doesn't seem like using fold for timestamps, now calls or dates makes sense. But maybe it should be passed. What do you think?

Closes: #872

Comment on lines -77 to -78
assert hasattr(before, "fold")
assert hasattr(after, "fold")
Copy link
Author

Choose a reason for hiding this comment

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

This basically checks for presence of the Arrow.fold property, seems unnecessary.

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Base: 100.00% // Head: 100.00% // No change to project coverage 👍

Coverage data is based on head (4d68b9c) compared to base (74a759b).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1139   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines         2319      2325    +6     
  Branches       492       495    +3     
=========================================
+ Hits          2319      2325    +6     
Impacted Files Coverage Δ
arrow/api.py 100.00% <ø> (ø)
arrow/arrow.py 100.00% <100.00%> (ø)
arrow/factory.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

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.

Allow fold kwarg in arrow.get()
2 participants