jorisvandenbossche commented on a change in pull request #9466:
URL: https://github.com/apache/arrow/pull/9466#discussion_r574499999



##########
File path: python/pyarrow/tests/test_dataset.py
##########
@@ -1802,6 +1802,29 @@ def test_open_dataset_from_fsspec(tempdir):
     assert dataset.schema.equals(table.schema)
 
 
+def test_filter_timestamp(tempdir):
+    # ARROW-11379
+    import pyarrow.parquet as pq
+    path = tempdir / "test_partition_timestamps"
+
+    table = pa.table({
+        "dates": ['2012-01-01', '2012-01-02'] * 5,
+        "id": range(10)})
+
+    # write dataset partitioned on dates (as strings)
+    part = ds.partitioning(table.select(['dates']).schema, flavor="hive")
+    ds.write_dataset(table, path, partitioning=part, format="feather")
+
+    # read dataset partitioned on dates (as timestamps)
+    part = ds.partitioning(pa.schema([("dates", pa.timestamp("s"))]),
+                           flavor="hive")
+    dataset = ds.dataset(path, format="feather", partitioning=part)
+
+    condition = ds.field("dates") > pd.Timestamp("2012-01-01")

Review comment:
       this line still causes a pandas dependency 
   It could be avoided by using `datetime.datetime`, but I think it is good to 
test both, because pandas Timestamp has nanosecond resolution, it gives a 
different casting need)
   




----------------------------------------------------------------
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.

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


Reply via email to