Skip to content

REF: Improve Situation around rule_code for DateOffsets #48210

Open
@CloseChoice

Description

@CloseChoice

Following the discussions in this PR, there are a couple of things that should be looked into, before changing rule_code:

  1. One thing that came to my mind is to add rule_code for DateOffsets. This would help us get rid of the except part in this PR
  2. Refactor parse_date_string to not need this information at all. As you mentioned REGR: NotImplementedError: Prefix not defined when slicing offset with loc #47547 (comment) freq is actually used in very limited cases (as I can see, it only used in the chain parse_time_string -> parse_datetime_string_with_reso -> _parse_dateabbr_string -> quarter_to_myear -> get_rule_month and in _parse_dateabbr_string where it is checked against M. So there might be a good way of working around this by finding the rule_month (as given by get_rule_month) and checking for M first and implementing a special case for this somewhere not so deep down in the chain.

There are also a couple todos written in the code, so I think we could improve here quite some things.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrequencyDateOffsetsRefactorInternal refactoring of code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions