pitrou commented on code in PR #47745:
URL: https://github.com/apache/arrow/pull/47745#discussion_r2416800606
##########
python/pyarrow/tests/parquet/test_parquet_writer.py:
##########
@@ -447,3 +447,41 @@ def
test_parquet_content_defined_chunking_parameters(tempdir):
# using min_chunk_size, max_chunk_size and norm_level
cdc_options = {"min_chunk_size": 32_768, "max_chunk_size": 65_536,
"norm_level": 1}
pq.write_table(table, path, use_content_defined_chunking=cdc_options)
+
+
[email protected]("time_type, time_unit", [
+ (pa.time32, "s"),
+ (pa.time32, "ms"),
+ (pa.time64, "us"),
+ (pa.time64, "ns"),
+])
[email protected]("utc_flag_val", [False, True])
+def test_arrow_writer_props_time_adjusted_to_utc(
+ tempdir,
+ utc_flag_val,
+ time_type,
+ time_unit,
+):
+ # GH-47441
+ filename = tempdir / "time_adjusted_to_utc.parquet"
+
+ time_values = [0, 123, 10_000, 100_000]
+
+ table = pa.table({
+ "time_col": pa.array(time_values, type=time_type(time_unit)),
+ })
+
+ schema = pa.schema([
+ ("time_col", time_type(time_unit)),
+ ])
+
+ with pq.ParquetWriter(
+ where=filename,
+ schema=schema,
+ use_time_adjusted_to_utc=utc_flag_val,
+ ) as writer:
+ writer.write_table(table)
+
+ result = pq.read_table(filename, schema=schema)
Review Comment:
Please let's validate the result.
```suggestion
result = pq.read_table(filename, schema=schema)
result.validate(full=True)
```
--
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]