AlenkaF commented on code in PR #47147: URL: https://github.com/apache/arrow/pull/47147#discussion_r2224326524
########## python/pyarrow/tests/test_pandas.py: ########## @@ -5265,3 +5270,76 @@ def test_bytes_column_name_to_pandas(): def test_is_data_frame_race_condition(): # See https://github.com/apache/arrow/issues/39313 test_util.invoke_script('arrow_39313.py') + + +def _get_pandas_df_w_attrs(): + df = pd.DataFrame({ + 'first_col': [1, 2, 3], + 'second_col': [4, 5, 6], + }) + + df.attrs = { + 'first_col': 'First Column', + 'second_col': 'Second Column', + 'desciption': 'Attributes Persistence Test DataFrame', + } + + return df + + +@pytest.mark.parquet +@pytest.mark.pandas +def test_attributes_metadata_persistence(tempdir): + # GH-45382: Add support for pandas DataFrame.attrs + # During the .parquet file writing, + # the attrs are serialised into json + # along with the rest of the pandas.DataFrame metadata. + # Whilst reading, the attributes are read from the json, + # and are added to the pandas.DataFrame object. + # This test ensures that this whole processes works as intended. + # This test might still pass even if the implementataion is faulty, + # since there is attributes injection happening + # while reading/writing on pandas' side Review Comment: I think this will also be tested on the CI build that uses the older version of pandas. -- 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-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org