-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: parse_dates may have columns not in dataframe #32320
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
read_csv will raise ValueError when columnes used for parse_dates are found in the dataframe.
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.
Thanks @sathyz
Just making some minor comments ahead of core members' review(s)
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.
Thanks for the PR! A mix of minor things / comments
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.
small comment, other lgtm.
One minor doc fix, but otherwise, these changes look good. Nice job with the testing! |
@gfyoung done! Thanks for the corrections. I didn't notice these mistakes. |
@pandas-dev/pandas-core : These |
What do I have to do? Do I have to fix it to merge this PR? |
you need to merge master see https://pandas.io/docs/development/contributing.html#updating-your-pull-request |
I am not sure what is failing in docs, how do I debug. |
@pandas-dev/pandas-core |
Any updates? How do I fix the problem in docs? |
The docs fetch a url from some other projects, to know the absolute url of a page when we write something like I guess that should be fixed not. A simple |
Done, please merge. |
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.
ping on green.
@pytest.mark.parametrize( | ||
"names, usecols, parse_dates, missing_cols", | ||
[ | ||
(None, ["val"], ["date", "time"], "date, time"), |
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.
add a tuple or other list-like in this test
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.
When I use tuple, _validate_parse_dates_arg throws the following error.
TypeError: Only booleans, lists, and dictionaries are accepted for the 'parse_dates' parameter
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.
Yea I guess this is only currently documented as supporting scalars, lists and dicts (not tuples)
@jreback done. Please review. |
Thanks @sathyz - great first PR |
read_csv will raise ValueError when columnes used for parse_dates are found in the dataframe.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff