Skip to content

Commit ebad86c

Browse files
committed
update exception message
1 parent c39864f commit ebad86c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

‎bigframes/session/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ def _read_pandas(
10531053
try:
10541054
return self._read_pandas_load_job(pandas_dataframe, api_name)
10551055
except pa.ArrowInvalid as e:
1056-
raise pa.ArrowInvalid(f"Unsupported dtype: `{e}`. ")
1056+
raise pa.ArrowInvalid(f"Could not convert with a BigQuery type: `{e}`. ") from e
10571057

10581058
def _read_pandas_inline(
10591059
self, pandas_dataframe: pandas.DataFrame
@@ -1068,7 +1068,7 @@ def _read_pandas_inline(
10681068
blocks.Block.from_local(pandas_dataframe, self)
10691069
)
10701070
except pa.ArrowInvalid as e:
1071-
raise pa.ArrowInvalid(f"Unsupported dtype: `{e}`. ")
1071+
raise pa.ArrowInvalid(f"Could not convert with a BigQuery type: `{e}`. ") from e
10721072
except ValueError: # Thrown by ibis for some unhandled types
10731073
return None
10741074
except pa.ArrowTypeError: # Thrown by arrow for types without mapping (geo).

‎tests/system/small/test_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ def test_read_pandas_index(session):
438438

439439

440440
def test_read_pandas_w_unsupported_mixed_dtype(session):
441-
with pytest.raises(pa.ArrowInvalid, match="Unsupported dtype"):
441+
with pytest.raises(pa.ArrowInvalid, match="Could not convert"):
442442
session.read_pandas(pd.DataFrame({"a": [1, "hello"]}))
443443

444444

0 commit comments

Comments
 (0)