-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Enable automatic writing of dates to Stata files #13710
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
self._convert_dates[key] | ||
) | ||
dtypes[key] = np.dtype(new_type) | ||
dtypes[key] = np.dtype(new_type) |
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 would blow up if they did convert_dates on a datetime64-tz aware type
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.
is_datetime64_dtype
is False for tz aware datetimes.
0b3a253
to
7b5f321
Compare
Current coverage is 84.53%
|
991ec0e
to
73f6565
Compare
@@ -432,7 +432,8 @@ def parse_dates_safe(dates, delta=False, year=False, days=False): | |||
d = parse_dates_safe(dates, year=True) | |||
conv_dates = d.year | |||
else: | |||
raise ValueError("fmt %s not understood" % fmt) |
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.
is this where you validate the supported format? (e.g. the tc and such). I think this would be a ValueError if its not in the list (yes unsupported sort of means this, but more likely it was a typo by the user). and datetime w/tz can be not implemented error.
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.
Revered this to ValueError since it should only raise if the type doesn't exist.
Automatically select type %tc for datetime[ns] columns Change ValueErrors to NotImplementedError for unsupported types Add tests for select exceptions Improve to_stata and StataWriter docstrings closes pandas-dev#12259
73f6565
to
f77e40a
Compare
thanks! |
git diff upstream/master | flake8 --diff
Automatically select type %tc for datetime[ns] columns
Change ValueErrors to NotImplementedError for unsupported types
Add tests for select exceptions
closes #12259