Skip to content

BUG: Repeated key words on datetime indexing methods (_parsed_string_to_bounds()) #39503

Closed
@boringow

Description

@boringow
  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • (optional) I have confirmed this bug exists on the master branch of pandas.


Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Readed! I will know for next time

Code Sample, a copy-pastable example

There is no need for code, as the error is on the function having repeated keywords.

Problem description

There are two repeated keywords on the master/pandas/core/indexes/datetimes.py#L560 and #L561.
I closed the issue #38121, as it is working fine, but as said, there are repeated keywords.

    valid_resos = {
        "year",
        "month",
        "quarter",
        "day",
        "hour",
        "minute",
        "second",
        "minute",
        "second",
        "millisecond",
        "microsecond",
    }

it should be:

    valid_resos = {
        "year",
        "month",
        "quarter",
        "day",
        "hour",
        "minute",
        "second",
        "millisecond",
        "microsecond",
    }

Reference here:

"minute",
"second",

Expected Output

    valid_resos = {
        "year",
        "month",
        "quarter",
        "day",
        "hour",
        "minute",
        "second",
        "millisecond",
        "microsecond",
    }

Output of pd.show_versions()

There is no need for versions. Pandas code in this case is fine. Just two repeated lines.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions