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



##########
File path: python/pyarrow/pandas_compat.py
##########
@@ -1021,6 +1021,7 @@ def _is_generated_index_name(name):
 _pandas_logical_type_map = {
     'date': 'datetime64[D]',
     'datetime': 'datetime64[ns]',
+    'datetimetz': 'datetime64[ns, tz]',

Review comment:
       ```suggestion
       'datetimetz': 'datetime64[ns]',
   ```
   
   I would keep this as a "proper" numpy dtype, and then you can check for 
`pandas_dtype == "datetimetz"` in the for loop below instead of checking for 
`dtype == 'datetime64[ns, tz]'`

##########
File path: python/pyarrow/tests/test_pandas.py
##########
@@ -237,6 +237,17 @@ def test_multiindex_columns_with_dtypes(self):
         df = pd.DataFrame([(1, 'a'), (2, 'b'), (3, 'c')], columns=columns)
         _check_pandas_roundtrip(df, preserve_index=True)
 
+    def test_multiindex_columns_with_tz(self):

Review comment:
       Small note on the test name: this is not actually using a MultiIndex 
column (it's a single level, but using a DatetimeIndex for the column names). 
So I would rename the test and move it up a little below where there are tests 
for different column index types (there seems to be already a test related to 
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