-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CLN: Enforce read_csv(keep_date_col, parse_dates) deprecations #58622
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
Conversation
cols_needed = [] | ||
|
||
cols_needed = list(cols_needed) | ||
if not isinstance(self.parse_dates, list): |
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.
This branch feels a bit odd in this method - this isn't handled by the caller at all?
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.
Yeah appears not. I suppose since this is called by the c parser and python parser maybe this was here to consolidate logic?
list(columns), self.index_col | ||
) | ||
self._name_processed = True | ||
date_index = self._get_complex_date_index(data, columns) |
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.
can _get_complex_date_index be removed?
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.
Good catch. Removed
warnings.warn( | ||
"The 'keep_date_col' keyword in pd.read_csv is deprecated and " | ||
"will be removed in a future version. Explicitly remove unwanted " | ||
"columns after parsing instead.", |
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 think i screwed up this deprecation. the message here suggests that the post-deprecation behavior will retain the un-parsed column, which i think is not the case.
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.
Yeah I don't think the workaround messaging was quite right, but I think it's OK since we didn't get any issues AFAICT where people were confused by this.
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.
Plus this keyword only really made sense when parse_dates
specified multiple columns which was clearly deprecated
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.
sounds good, thanks for taking a look
depr = True | ||
if depr: | ||
warnings.warn( | ||
"Support for nested sequences for 'parse_dates' in pd.read_csv " |
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.
did you keep any tests that current get here?
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.
Yeah there are tests where parse_dates
is a list and valid and a list and not valid
Going to merge this in. Happy to follow up if needed |
xref #56569