diff --git a/bigframes/session/__init__.py b/bigframes/session/__init__.py index 6cfaf48493..27707c21fd 100644 --- a/bigframes/session/__init__.py +++ b/bigframes/session/__init__.py @@ -707,10 +707,8 @@ def _read_pandas_inline( try: local_block = blocks.Block.from_local(pandas_dataframe, self) inline_df = dataframe.DataFrame(local_block) - except pa.ArrowInvalid as e: - raise pa.ArrowInvalid( - f"Could not convert with a BigQuery type: `{e}`. " - ) from e + except pa.ArrowInvalid: # Thrown by arrow for unsupported types, such as geo. + return None except ValueError: # Thrown by ibis for some unhandled types return None except pa.ArrowTypeError: # Thrown by arrow for types without mapping (geo). diff --git a/tests/system/small/test_series.py b/tests/system/small/test_series.py index f1c60664a1..6cdb74fcf7 100644 --- a/tests/system/small/test_series.py +++ b/tests/system/small/test_series.py @@ -23,6 +23,7 @@ import pandas as pd import pyarrow as pa # type: ignore import pytest +import shapely # type: ignore import bigframes.pandas import bigframes.series as series @@ -213,6 +214,19 @@ def test_series_construct_from_list_escaped_strings(): pd.testing.assert_series_equal(bf_result.to_pandas(), pd_result) +def test_series_construct_geodata(): + pd_series = pd.Series( + [shapely.Point(1, 1), shapely.Point(2, 2), shapely.Point(3, 3)], + dtype=gpd.array.GeometryDtype(), + ) + + series = bigframes.pandas.Series(pd_series) + + pd.testing.assert_series_equal( + pd_series, series.to_pandas(), check_index_type=False + ) + + @pytest.mark.parametrize( ["col_name", "expected_dtype"], [