Skip to content
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

Merged
merged 6 commits into from
May 26, 2015
Merged

Conversation

cpcloud
Copy link
Member

@cpcloud cpcloud commented May 20, 2015

@cpcloud cpcloud added this to the 0.8.1 milestone May 20, 2015
@cpcloud cpcloud added the bug label May 20, 2015
@cpcloud cpcloud self-assigned this May 20, 2015
@cpcloud
Copy link
Member Author

cpcloud commented May 20, 2015

@mrocklin okay with this?

@cpcloud cpcloud changed the title Fix issue when storing datetimes and pandas Timestamps in an expression Fix issue when converting datetimes and pandas Timestamps in an expression May 20, 2015
@@ -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}
Copy link
Member

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?

Copy link
Member Author

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.

@cpcloud
Copy link
Member Author

cpcloud commented May 21, 2015

I'll add that one thing that's nice about pandas Timestamps is that they can handle the precision of other systems' timestamps, such as kdb which also has nanosecond precision timestamp types.

@cpcloud
Copy link
Member Author

cpcloud commented May 26, 2015

merging

cpcloud added a commit that referenced this pull request May 26, 2015
Fix issue when converting datetimes and pandas Timestamps in an expression
@cpcloud cpcloud merged commit 5562599 into blaze:master May 26, 2015
@cpcloud cpcloud deleted the ts-fix branch May 26, 2015 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants