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

Fix floats appearing in Humanize output for locales that override _format_timeframe #986

Merged
merged 6 commits into from
Jun 24, 2021

Conversation

anishnya
Copy link
Member

@anishnya anishnya commented Jun 6, 2021

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

Closes #789. The issue was the locales that were overriding _format_timeframe were not truncating their output. The solution is extremely similar to #790, the difference being that we don't truncate delta on the call to _format_relative. An important note is that contributors adding new locales that override describe and describe_multi must ensure their calls to _format_timeframe have delta truncated. This might be a good note to add to #983.

@codecov
Copy link

codecov bot commented Jun 6, 2021

Codecov Report

Merging #986 (b42f4c2) into master (f1df58b) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #986   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2111      2111           
  Branches       333       333           
=========================================
  Hits          2111      2111           
Impacted Files Coverage Δ
arrow/locales.py 100.00% <100.00%> (ø)

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 f1df58b...b42f4c2. Read the comment docs.

Copy link
Member

@jadchaar jadchaar left a comment

Choose a reason for hiding this comment

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

LGTM

@jadchaar jadchaar merged commit b8a9df7 into arrow-py:master Jun 24, 2021
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.

Floats in humanize output for languages overriding _format_timeframe
2 participants