rmnskb commented on code in PR #47977:
URL: https://github.com/apache/arrow/pull/47977#discussion_r2469708758
##########
python/pyarrow/pandas_compat.py:
##########
@@ -277,6 +277,15 @@ def construct_metadata(columns_to_convert, df,
column_names, index_levels,
attributes = df.attrs if hasattr(df, "attrs") else {}
+ try:
+ json.dumps(attributes)
+ except (TypeError, OverflowError):
Review Comment:
I didn't want to include a broad exception handling, because it would also
catch some unwanted exceptions (e.g. `KeyboardInterrupt`).
I will look at what exceptions this process can possibly raise, and will
include them exhaustively.
--
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]