Pandas.Timestamp timezone and unit gets modified when creating new Polars Dataframe #18127
Open
2 tasks done
Labels
A-timeseries
Area: date/time functionality
bug
Something isn't working
python
Related to Python Polars
Checks
Reproducible example
The following throws an error, see Log output section.
Log output
This is from attempting to create a Polars Dataframe using Numpy's datetime64 value:
Issue description
Polars should not be silently modifying data without notifying the developer. An exception should be thrown if data cannot be converted, rather than silently erasing information, in the case of timezone, or modifying it, in the case of resolution.
In the above example, timezone is set to None and nanosecond resolution is truncated to microseconds.
Expected behavior
Timezone information should be retained as well as resolution. If this cannot be done, an exception should be thrown.
Installed versions
--------Version info---------
Polars: 1.0.0
Index type: UInt32
Platform: Linux-6.8.0-39-generic-x86_64-with-glibc2.39
Python: 3.11.9 (main, Apr 27 2024, 21:16:11) [GCC 13.2.0]
----Optional dependencies----
adbc_driver_manager:
cloudpickle: 3.0.0
connectorx:
deltalake:
fastexcel:
fsspec: 2024.6.1
gevent:
great_tables:
hvplot:
matplotlib: 3.9.1
nest_asyncio: 1.6.0
numpy: 1.24.4
openpyxl:
pandas: 2.2.2
pyarrow: 16.1.0
pydantic: 2.8.2
pyiceberg:
sqlalchemy: 2.0.31
torch: 2.3.1+cu121
xlsx2csv:
xlsxwriter:
None
The text was updated successfully, but these errors were encountered: