Skip to content

Commit b6211ee

Browse files
authored
chore: remove to_pandas_dtypes_overrides dead code (#404)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent fb29e56 commit b6211ee

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

bigframes/dtypes.py

-16
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import typing
2121
from typing import Any, Dict, Iterable, Literal, Tuple, Union
2222

23-
import bigframes_vendored.google_cloud_bigquery._pandas_helpers as gcb3p_pandas_helpers
2423
import bigframes_vendored.ibis.backends.bigquery.datatypes as third_party_ibis_bqtypes
2524
import bigframes_vendored.ibis.expr.operations as vendored_ibis_ops
2625
import geopandas as gpd # type: ignore
@@ -492,21 +491,6 @@ def cast_ibis_value(
492491
)
493492

494493

495-
def to_pandas_dtypes_overrides(schema: Iterable[bigquery.SchemaField]) -> Dict:
496-
"""For each STRUCT field, make sure we specify the full type to use."""
497-
# TODO(swast): Also override ARRAY fields.
498-
dtypes = {}
499-
for field in schema:
500-
if field.field_type == "RECORD" and field.mode != "REPEATED":
501-
# TODO(swast): We're using a private API here. Would likely be
502-
# better if we called `to_arrow()` and converted to a pandas
503-
# DataFrame ourselves from that.
504-
dtypes[field.name] = pd.ArrowDtype(
505-
gcb3p_pandas_helpers.bq_to_arrow_data_type(field)
506-
)
507-
return dtypes
508-
509-
510494
def is_dtype(scalar: typing.Any, dtype: Dtype) -> bool:
511495
"""Captures whether a scalar can be losslessly represented by a dtype."""
512496
if scalar is None:

0 commit comments

Comments
 (0)