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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Humanize Format Relative Error For Multiple Granularities #996

Closed
anishnya opened this issue Jun 27, 2021 · 0 comments 路 Fixed by #1077 路 May be fixed by #997
Closed

Humanize Format Relative Error For Multiple Granularities #996

anishnya opened this issue Jun 27, 2021 · 0 comments 路 Fixed by #1077 路 May be fixed by #997
Labels

Comments

@anishnya
Copy link
Member

Issue Description

System Info

  • 馃枼 OS name and version:
  • 馃悕 Python version:
  • 馃徆 Arrow version:
    import arrow
    arw = arrow.Arrow(2013, 1, 1, 0, 0, 0)
    later = arw.shift(seconds=3600)
    humanize_string = arw.humanize(later, granularity=["second", "hour", "day", "month", "year"],)
    print(humanize_string)
    >>> "in 0 years 0 months 0 days an hour and 0 seconds"

"in 0 years 0 months 0 days an hour and 0 seconds" should be "0 years 0 months 0 days an hour and 0 seconds ago". I suspect this is dude to the fact in describe-mutli we take timeframes[-1], which in this case would be 0. This results in format relative defaulting to it's positive version. We might need a linear search through all the timeframe units to better determine the correct relative phrase to use.

@anishnya anishnya added the bug label Jun 27, 2021
MarkKoz added a commit to MarkKoz/arrow that referenced this issue Dec 24, 2021
Since arrow-py#996 was fixed by arrow-py#1077, the test no longer needs to use the
incorrect data to work around the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant