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

refactor(python): Simplify rust side of datetime #19459

Merged
merged 1 commit into from
Oct 26, 2024

Conversation

eitsupi
Copy link
Contributor

@eitsupi eitsupi commented Oct 26, 2024

Since the Python side of the function is set up so that None does not come here, it does not seem to make sense for ambiguous to actually be an Option.

def datetime_(
year: int | IntoExpr,
month: int | IntoExpr,
day: int | IntoExpr,
hour: int | IntoExpr | None = None,
minute: int | IntoExpr | None = None,
second: int | IntoExpr | None = None,
microsecond: int | IntoExpr | None = None,
*,
time_unit: TimeUnit = "us",
time_zone: str | None = None,
ambiguous: Ambiguous | Expr = "raise",
) -> Expr:

ambiguous_expr = parse_into_expression(ambiguous, str_as_lit=True)

@eitsupi eitsupi changed the title refactor(python): simplify datetime rust side refactor(python): Simplify rust side of datetime Oct 26, 2024
@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars and removed title needs formatting labels Oct 26, 2024
Copy link

codecov bot commented Oct 26, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 79.95%. Comparing base (7a2f547) to head (8388434).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/polars-python/src/functions/lazy.rs 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19459      +/-   ##
==========================================
+ Coverage   79.94%   79.95%   +0.01%     
==========================================
  Files        1534     1534              
  Lines      211059   211057       -2     
  Branches     2444     2444              
==========================================
+ Hits       168727   168747      +20     
+ Misses      41777    41755      -22     
  Partials      555      555              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ritchie46 ritchie46 merged commit e058bd3 into pola-rs:main Oct 26, 2024
20 checks passed
@eitsupi eitsupi deleted the refactor-datetime branch October 26, 2024 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement python Related to Python Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants