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

Docstring of time_delta argument minimum_unit conflicts with implementation #582

Open
mjpieters opened this issue Apr 25, 2023 · 0 comments

Comments

@mjpieters
Copy link

The docstring for time_delta() says this about the minimum_unit argument:

        minimum_unit: The lowest unit that can be used. Options: "years", "months",
            "days", "hours", "minutes", "seconds", "milliseconds" or "microseconds".

but the implementation will raise an exception if you try to use any value larger than "seconds":

    tmp = Unit[minimum_unit.upper()]
    if tmp not in (Unit.SECONDS, Unit.MILLISECONDS, Unit.MICROSECONDS):
        raise ValueError(f"Minimum unit '{minimum_unit}' not supported")

Either update the docstring to only mention the last three options, or update the code to support the other units too.

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

No branches or pull requests

1 participant