We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Arr.get does not seem to keep the data type of the column.
Below an example
import polars as pl from datetime import datetime df = pl.DataFrame({ 'date_col': [[datetime(2023,2,1).date(), datetime(2023,2,2).date()]], 'datetime_col': [[datetime(2023,2,1), datetime(2023,2,2)]] }) shape: (1, 2) ┌──────────────────────────┬─────────────────────────────────────┐ │ date_col ┆ datetime_col │ │ --- ┆ --- │ │ list[date] ┆ list[datetime[μs]] │ ╞══════════════════════════╪═════════════════════════════════════╡ │ [2023-02-01, 2023-02-02] ┆ [2023-02-01 00:00:00, 2023-02-02... │ └──────────────────────────┴─────────────────────────────────────┘ df.with_columns( pl.all().arr.get(1).suffix('_element_1') ) shape: (1, 4) ┌──────────────┬─────────────────────────────────────┬────────────────────┬────────────────────────┐ │ date_col ┆ datetime_col ┆ date_col_element_1 ┆ datetime_col_element_1 │ │ --- ┆ --- ┆ --- ┆ --- │ │ list[date] ┆ list[datetime[μs]] ┆ i32 ┆ i64 │ ╞══════════════╪═════════════════════════════════════╪════════════════════╪════════════════════════╡ │ [2023-02-01, ┆ [2023-02-01 00:00:00, 2023-02-02... ┆ 19390 ┆ 1675296000000000 │ │ 2023-02-02] ┆ ┆ ┆ │ └──────────────┴─────────────────────────────────────┴────────────────────┴────────────────────────┘
I can cast back the columns to date and datetime, but I would expect arr.get to not change the data type.
Your thoughts?
---Version info--- Polars: 0.16.7 Index type: UInt32 Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.31 Python: 3.11.1 (main, Dec 7 2022, 01:11:44) [GCC 9.4.0] ---Optional dependencies--- pyarrow: 11.0.0 pandas: 1.5.2 numpy: 1.24.0 fsspec: <not installed> connectorx: <not installed> xlsx2csv: 0.8.1 deltalake: <not installed> matplotlib: 3.6.2
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Polars version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of Polars.
Issue description
Arr.get does not seem to keep the data type of the column.
Below an example
Reproducible example
Expected behavior
I can cast back the columns to date and datetime, but I would expect arr.get to not change the data type.
Your thoughts?
Installed versions
The text was updated successfully, but these errors were encountered: