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): Avoid unnecessary cast in Series constructor #14650

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

stinodego
Copy link
Member

@stinodego stinodego commented Feb 23, 2024

By requiring an exact dtype match we could end up in this branch when it's not required. Example:

from datetime import datetime
import polars as pl

df = pl.DataFrame({"a": [[datetime(1990, 1, 1)]]}, schema={"a": pl.List(pl.Datetime)})

We should just use the equality operator here.

@github-actions github-actions bot added internal An internal refactor or improvement python Related to Python Polars labels Feb 23, 2024
@stinodego stinodego marked this pull request as ready for review February 23, 2024 09:15
@stinodego stinodego merged commit ad30bab into main Feb 23, 2024
15 of 16 checks passed
@stinodego stinodego deleted the fix-constructor-dtype-check branch February 23, 2024 09:24
@c-peters c-peters added the accepted Ready for implementation label Feb 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Ready for implementation internal An internal refactor or improvement python Related to Python Polars
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants