Skip to content

Commit bd29d23

Browse files
tritsystemclaude
andcommitted
apacheGH-39914: [Python] Remove remaining comments per review
@jorisvandenbossche asked for less verbose comments; on a closer look, both remaining comments were restating what the code already says on its own (the except clause's tuple, and the test body), rather than carrying any non-obvious why. Removed rather than further reflowed. No logic or behavior changed. Co-Authored-By: Claude Sonnet 5 <[email protected]>
1 parent b3d0461 commit bd29d23

2 files changed

Lines changed: 0 additions & 12 deletions

File tree

‎python/pyarrow/pandas_compat.py‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -905,11 +905,6 @@ def _get_extension_dtypes(table, columns_metadata, types_mapper, options, catego
905905
try:
906906
pandas_dtype = _pandas_api.pandas_dtype(dtype)
907907
except (TypeError, ValueError):
908-
# Complex Arrow types (list/struct/dict/map) serialize to a numpy_type
909-
# string pandas_dtype() can't parse. np.dtype() runs first and raises
910-
# ValueError for strings with a comma (struct/dict/map) or TypeError
911-
# otherwise (list); either way, don't guess ArrowDtype for a string we
912-
# can't parse. Skip the column. GH-39914 / pandas-dev/pandas#53011.
913908
continue
914909
if isinstance(pandas_dtype, _pandas_api.extension_dtype):
915910
if isinstance(pandas_dtype, _pandas_api.pd.StringDtype):

‎python/pyarrow/tests/test_pandas.py‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4567,13 +4567,6 @@ def test_to_pandas_extension_dtypes_mapping_complex_type():
45674567

45684568

45694569
def test_to_pandas_extension_dtypes_mapping_complex_type_no_types_mapper():
4570-
# GH-39914: without types_mapper, pandas metadata stores a numpy_type string
4571-
# like "list<item: string>[pyarrow]" for complex ArrowDtype columns, which
4572-
# pandas_dtype() can't parse back (TypeError for list, ValueError for
4573-
# struct/dict/map -- see the fix above). to_pandas() used to crash outright
4574-
# instead of skipping the column; see pandas-dev/pandas#53011. The ArrowDtype
4575-
# isn't expected to round-trip here -- an unparseable string isn't necessarily
4576-
# still an ArrowDtype, so these columns fall back to normal conversion.
45774570
list_type = pd.ArrowDtype(pa.list_(pa.string()))
45784571
df0 = pd.DataFrame({
45794572
"a": pd.Series([["x"], ["x", "y"]], dtype=list_type),

0 commit comments

Comments
 (0)