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

feat(python): return Datetime/Duration with appropriate timeunit when inferring from pytype #5127

Merged
merged 1 commit into from
Oct 6, 2022
Merged

feat(python): return Datetime/Duration with appropriate timeunit when inferring from pytype #5127

merged 1 commit into from
Oct 6, 2022

Conversation

alexander-beedie
Copy link
Collaborator

@alexander-beedie alexander-beedie commented Oct 6, 2022

Minor improvement for inference from python datetime/timedelta - include timeunit:

from polars.datatypes import py_type_to_dtype
from datetime import datetime, timedelta

py_type_to_dtype(datetime)  # >> pl.Datetime("us")
py_type_to_dtype(timedelta) # >> pl.Duration("us")

@github-actions github-actions bot added enhancement New feature or an improvement of an existing feature python Related to Python Polars labels Oct 6, 2022
@alexander-beedie
Copy link
Collaborator Author

@ritchie46: seems to be a runner failure at the moment (also hitting #5126 and #5128) 🤔

Error: Can't use 'tar -xzf' extract archive file: 
  /home/runner/work/_actions/_temp_f291320b-9e23-4877-b85f-b1323f0b7a16/ad1d0053-5f26-412a-9e20-ab25370529a0.tar.gz. 
return code: 2.

@ritchie46
Copy link
Member

Rerunning them now.

@ritchie46 ritchie46 merged commit 798882d into pola-rs:master Oct 6, 2022
@alexander-beedie alexander-beedie deleted the improved-dtype-from-pytype branch October 7, 2022 04:45
zundertj pushed a commit to zundertj/polars that referenced this pull request Jan 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or an improvement of an existing feature python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants