-
Notifications
You must be signed in to change notification settings - Fork 608
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
docs(examples): add temporal strftime
examples
#10362
Conversation
I was going to add strftime examples for TimeValue, but admittedly, was running into difficulties here. In [1]: from datetime import time
In [2]: from ibis.interactive import *
In [3]: t = ibis.memtable([time(10, 28, 3)], schema=ibis.Schema({"time_col": "time"}))
In [4]: t
Out[4]:
┏━━━━━━━━━━┓
┃ time_col ┃
┡━━━━━━━━━━┩
│ time │
├──────────┤
│ 10:28:03 │
└──────────┘
In [5]: t.time_col.strftime("%H:%M")
BinderException: Binder Error: No function matches the given name and argument types 'strftime(TIME, STRING_LITERAL)'. You might need to add explicit type casts.
Candidate functions:
strftime(DATE, VARCHAR) -> VARCHAR
strftime(TIMESTAMP, VARCHAR) -> VARCHAR
strftime(TIMESTAMP_NS, VARCHAR) -> VARCHAR
strftime(VARCHAR, DATE) -> VARCHAR
strftime(VARCHAR, TIMESTAMP) -> VARCHAR
strftime(VARCHAR, TIMESTAMP_NS) -> VARCHAR
strftime(TIMESTAMP WITH TIME ZONE, VARCHAR) -> VARCHAR |
29cf3e3
to
737f5b6
Compare
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.
Looks great, just some minor suggestions.
Co-authored-by: Phillip Cloud <[email protected]>
Co-authored-by: Phillip Cloud <[email protected]>
Thank you! Removing the explicit schema does make it more concise. I added those suggestions and linted again. |
The Trino failures are unrelated and already fixed upstream, merging! |
strftime
examples
Thank you so much! Also, I appreciate the parenthesis fix. |
Description of changes
Adding examples for TimestampValue and DateValue
strftime
methods.I wanted to cover what I felt like were common usage patterns.
Issues closed
Resolves #10354
^^ I intend to keep adding more of these, but don't know it it's worthwhile to keep that issue open.