Skip to content

Humanize doesn't support "quarter" for granularity #1019

@krisfremen

Description

@krisfremen

Issue Description

Humanize doesn't seem to support granularity of "quarter".

But the error raised seems to suggest that it does:

if not granularity:
    raise ValueError(
        "Empty granularity list provided. "
        "Please select one or more from ['second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year']."
    )
>>> arrow.Arrow.utcnow().humanize(granularity=["quarter"])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/krisfremen/projects/arrow/arrow/arrow.py", line 1251, in humanize
    raise ValueError(
ValueError: Invalid level of granularity. Please select between 'second', 'minute', 'hour', 'day', 'week', 'month' or 'year'.
>>> arrow.Arrow.utcnow().humanize(granularity=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/krisfremen/projects/arrow/arrow/arrow.py", line 1263, in humanize
    raise ValueError(
ValueError: Empty granularity list provided. Please select one or more from ['second', 'minute', 'hour', 'day', 'week', 'month', 'quarter', 'year'].

System Info

  • 🖥 OS name and version: Debian 10.10
  • 🐍 Python version: Python 3.9.1
  • 🏹 Arrow version: 1.1.1 or master

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions