jonmmease commented on issue #39539:
URL: https://github.com/apache/arrow/issues/39539#issuecomment-2014943808

   Let me know if you think this is a distinct issue, but I ran into a 
different error message when converting a Date32 from Polars through the 
DataFrame interchange protocol.
   
   ```python
   import datetime
   import polars as pl
   from pyarrow.interchange import from_dataframe
   
   from_dataframe(pl.DataFrame({"date": [datetime.date(2024, 3, 22)]}))
   ```
   ```
   ---------------------------------------------------------------------------
   NotImplementedError                       Traceback (most recent call last)
   ...
   File 
[.../envs/default/lib/python3.11/site-packages/pyarrow/interchange/from_dataframe.py:563]
   in validity_buffer_nan_sentinel(data_pa_buffer, data_type, describe_null, 
length, offset, allow_copy)
       537 """
       538 Build a PyArrow buffer from NaN or sentinel values.
       539 
      (...)
       560 pa.Buffer
       561 """
       562 kind, bit_width, _, _ = data_type
   --> 563 data_dtype = map_date_type(data_type)
       564 null_kind, sentinel_val = describe_null
       566 # Check for float NaN values
   
   File 
[...envs/default/lib/python3.11/site-packages/pyarrow/interchange/from_dataframe.py:332](http://localhost:8889/lab/workspaces/auto-z/tree/scratch/bugs/~/VegaFusion/repos/altair/.pixi/envs/default/lib/python3.11/site-packages/pyarrow/interchange/from_dataframe.py#line=331),
 in map_date_type(data_type)
       329 kind, bit_width, f_string, _ = data_type
       331 if kind == DtypeKind.DATETIME:
   --> 332     unit, tz = parse_datetime_format_str(f_string)
       333     return pa.timestamp(unit, tz=tz)
       334 else:
   
   File 
[.../envs/default/lib/python3.11/site-packages/pyarrow/interchange/from_dataframe.py:324](http://localhost:8889/lab/workspaces/auto-z/tree/scratch/bugs/~/VegaFusion/repos/altair/.pixi/envs/default/lib/python3.11/site-packages/pyarrow/interchange/from_dataframe.py#line=323),
 in parse_datetime_format_str(format_str)
       320         unit += "s"
       322     return unit, tz
   --> 324 raise NotImplementedError(f"DateTime kind is not supported: 
{format_str}")
   
   NotImplementedError: DateTime kind is not supported: tdD
   ```
   
   What's the current thinking on the best way forward to support this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to