AlenkaF commented on a change in pull request #12522:
URL: https://github.com/apache/arrow/pull/12522#discussion_r835335739
##########
File path: python/pyarrow/tests/strategies.py
##########
@@ -96,10 +103,16 @@
pa.time64('us'),
pa.time64('ns')
])
+if tzst:
Review comment:
Just a note to myself: I get strange errors if applying this correction
⬆️
```
python/pyarrow/tests/test_pandas.py:1052: in
test_python_datetime_with_pytz_timezone
_check_pandas_roundtrip(df)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
df = datetime
0 2018-01-01 12:23:45+00:00
expected = datetime
0 2018-01-01 12:23:45+00:00, use_threads = False, expected_schema = None
check_dtype = True, schema = None, preserve_index = False, as_batch = False
def _check_pandas_roundtrip(df, expected=None, use_threads=False,
expected_schema=None,
check_dtype=True, schema=None,
preserve_index=False,
as_batch=False):
klass = pa.RecordBatch if as_batch else pa.Table
table = klass.from_pandas(df, schema=schema,
preserve_index=preserve_index,
nthreads=2 if use_threads else 1)
result = table.to_pandas(use_threads=use_threads)
if expected_schema:
# all occurrences of _check_pandas_roundtrip passes
expected_schema
# without the pandas generated key-value metadata
assert table.schema.equals(expected_schema)
if expected is None:
expected = df
> tm.assert_frame_equal(result, expected, check_dtype=check_dtype,
check_index_type=('equiv' if preserve_index
else False))
E AssertionError: Attributes of DataFrame.iloc[:, 0] (column
name="datetime") are different
E
E Attribute "dtype" are different
E [left]: datetime64[ns, UTC]
E [right]: datetime64[ns, UTC]
python/pyarrow/tests/test_pandas.py:98: AssertionError
```
Will have to further look into 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]