Skip to content

REF: Improve Situation around rule_code for DateOffsets #48210

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

Open
CloseChoice opened this issue Aug 23, 2022 · 0 comments
Open

REF: Improve Situation around rule_code for DateOffsets #48210

CloseChoice opened this issue Aug 23, 2022 · 0 comments
Labels
Frequency DateOffsets Refactor Internal refactoring of code

Comments

@CloseChoice
Copy link
Member

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.

@CloseChoice CloseChoice added Refactor Internal refactoring of code Frequency DateOffsets labels Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frequency DateOffsets Refactor Internal refactoring of code
Projects
None yet
Development

No branches or pull requests

1 participant