-
Notifications
You must be signed in to change notification settings - Fork 391
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
Fix issue when converting datetimes and pandas Timestamps in an expression #1097
Conversation
@mrocklin okay with this? |
@@ -63,7 +64,7 @@ def _print_python(expr, leaves=None): | |||
|
|||
@dispatch((datetime.datetime, datetime.date)) | |||
def _print_python(expr, leaves=None): | |||
return repr(expr), {'datetime': datetime} | |||
return repr(expr), {'datetime': datetime, 'Timestamp': pd.Timestamp} |
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.
Are there cases where we intended to print python datetime objects that we actually end up printing Pandas Timestamps? If so is there an issue? Do we ever not assume that pandas is around?
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.
Are there cases where we intended to print python datetime objects that we actually end up printing Pandas Timestamps?
Not sure. FWIW, Timestamp
is a subclass of datetime.datetime
.
Do we ever not assume that pandas is around?
No, pandas is a hard dependency.
I'll add that one thing that's nice about pandas |
merging |
Fix issue when converting datetimes and pandas Timestamps in an expression
cc @mrocklin