Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bigframes/core/compile/ibis_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,12 @@ def cast_ibis_value(
),
ibis_dtypes.Decimal(precision=38, scale=9): (
ibis_dtypes.float64,
ibis_dtypes.int64,
ibis_dtypes.Decimal(precision=76, scale=38),
),
ibis_dtypes.Decimal(precision=76, scale=38): (
ibis_dtypes.float64,
ibis_dtypes.int64,
ibis_dtypes.Decimal(precision=38, scale=9),
),
ibis_dtypes.time: (
Expand Down
10 changes: 10 additions & 0 deletions tests/system/small/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3080,6 +3080,16 @@ def test_astype(scalars_df_index, scalars_pandas_df_index, column, to_type):
pd.testing.assert_series_equal(bf_result, pd_result)


@skip_legacy_pandas
def test_astype_numeric_to_int(scalars_df_index, scalars_pandas_df_index):
column = "numeric_col"
to_type = "Int64"
bf_result = scalars_df_index[column].astype(to_type).to_pandas()
# Round to the nearest whole number to avoid TypeError
pd_result = scalars_pandas_df_index[column].round(0).astype(to_type)
pd.testing.assert_series_equal(bf_result, pd_result)


@pytest.mark.parametrize(
("column", "to_type"),
[
Expand Down