Polars does not retain timezone information when reading data from a nested dictionary #20766
Open
2 tasks done
Labels
A-temporal
Area: date/time functionality
bug
Something isn't working
P-low
Priority: low
python
Related to Python Polars
Checks
Reproducible example
Log output
Issue description
I need to read data from a legacy data source that returns data as a list of nested objects. This format can be unnested to a regular table. However, in this process the timezone information is dropped from the column schema.
There seem to be a few related issues, but I think this one is not covered by the other issues.
#20264: The suggested workaround is using a dictionary, which I use here and is not working for nested dictionaries.
#19509: This one seems to break when there is a None value in the timestamp field, which I do not have in my example.
#19268: Actually gives an error, I do not get an error. Plus, I'm not using
map_elements
.Expected behavior
The timezone information is correctly parsed (the Europe/Amsterdam time is converted to UTC), however there is no timezone set on the column dtype. I expect the column dtype in the broken example to be
datetime[μs, UTC]
.Installed versions
The text was updated successfully, but these errors were encountered: