You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "rhshadrach (via GitHub)" <gi...@apache.org> on 2025/11/02 13:31:53 UTC

[I] Using pandas Period in filters for parquet fails [arrow]

rhshadrach opened a new issue, #48023:
URL: https://github.com/apache/arrow/issues/48023

   ### Describe the bug, including details regarding any error messages, version, and platform.
   
   ```python
   import pandas as pd
   # Ensure `ArrowPeriodType` is registered
   import pandas.core.arrays.arrow.extension_types
   
   df = pd.DataFrame(
       {
           "month": pd.period_range("2024-01", "2024-12", freq="M"),
           "data": range(12),
       }
   )
   df.to_parquet("test.parquet", engine="pyarrow")
   
   pd.read_parquet(
       "test.parquet",
       engine="pyarrow",
       filters=[("month", ">=", pd.Period("2024-07", freq="M"))]
   )
   # Could not convert Period('2024-07', 'M') with type Period: did not 
   # recognize Python value type when inferring an Arrow data type
   ```
   
   A similar example using `pd.Timestamp` succeeds. It's not clear to me if something on the pandas side needs to be done here.
   
   Original pandas report: https://github.com/pandas-dev/pandas/issues/62769
   
   ### Component(s)
   
   Parquet, Python


-- 
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: issues-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] Using pandas Period in filters for parquet fails [arrow]

Posted by "WillAyd (via GitHub)" <gi...@apache.org>.
WillAyd commented on issue #48023:
URL: https://github.com/apache/arrow/issues/48023#issuecomment-3497787409

   My assumption is that the timestamp case works because the pandas timestamp can be losslessly converted to arrow's, and a compute expression can be built on top of that. Period being custom to pandas and not having a lossless arrow equivalent makes it rather challenging to use in compute


-- 
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: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org