You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Reproducible example
# OPTION 1pl.read_csv(
source="a\n1\n2\n3".encode(),
schema={"x": pl.UInt16},
dtypes={"x": pl.Int32}, # no effect
)
# OPTION 2pl.read_csv(
source="a\n1\n2\n3".encode(),
dtypes={"x": pl.Int32}, # works (I think this is also problematic because there is no "x" column, creating an issue)
)
# OPTION 1pl.read_csv(
source="a\n1\n2\n3".encode(),
schema={"x": pl.UInt16},
dtypes=[pl.Int32], # works!
)
the dtypes parameter behaves very buggy and unexpected
it does NOT work in dict format the the schema is also specified
it DOES work in dict format if no schema is specified but renames the column which is incorrect imo and inconsistent with DataFrame creation behaviour
is DOES work in list format
Expected behavior
behaviour should be consistent and what the user expects. Currently very confusing can you actually do not know the result before you run the code because there seems to be much "magic" behind the scenes.
creating a separate issue for this but imo there needs to be a slight rework of schema and dtypes on multiple levels to create a good and reasonable user experience! (I am open to look into this myself)
Installed versions
0.20.7
The text was updated successfully, but these errors were encountered:
Checks
Reproducible example
Log output
Issue description
the
dtypes
parameter behaves very buggy and unexpectedschema
is also specifiedschema
is specified but renames the column which is incorrect imo and inconsistent with DataFrame creation behaviourExpected behavior
behaviour should be consistent and what the user expects. Currently very confusing can you actually do not know the result before you run the code because there seems to be much "magic" behind the scenes.
creating a separate issue for this but imo there needs to be a slight rework of
schema
anddtypes
on multiple levels to create a good and reasonable user experience! (I am open to look into this myself)Installed versions
The text was updated successfully, but these errors were encountered: