Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
REGR: NotImplementedError: Prefix not defined when slicing offset with loc #47547
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
REGR: NotImplementedError: Prefix not defined when slicing offset with loc #47547
Changes from all commits
5fc5b04
92c499e
e92c3e2
7086415
6572ad2
62abb79
d9fa426
fb11c66
b2ae03d
07af101
54bd158
d6a219b
d9c85e5
693bcc7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice, I don't think we actually run into cases that need this. For example,
freqstr
for the DateOffset case gives:This "<DateOffset: days=1>" string is never going to be useful. But in practice, it also seems that
parsing.parse_time_string
only actually usesfreq
in very few cases. From a quick look, it only seems to use it if it is exactly equal to "M", or in case of parsing quarters. Here I could create a snippet where passing the freq actually impacts the result:But, so this only is for quarterly offsets, and those do define a rule_code, so you probably don't run into this issue with that kind of freqs.
This line
freq = getattr(self, "freqstr", getattr(self, "inferred_freq", None))
is restoring what we did before #42149, so that's good for a regression fix in the bug-fix release. But we should maybe also see if we can just remove it later on (and just pass None here if rule_code isn't defined?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked passing None if
rule_code
isn't defined and a couple of tests fail in this case. Didn't look into it further though. But I think it should be possible to improve the situation aroundrule_code
.