Skip to content

chore: remove to_pandas_dtypes_overrides dead code #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
chore: remove to_pandas_dtypes_overrides dead code
  • Loading branch information
SalemJorden committed Mar 4, 2024
commit 031b345fce988dc13468c145752144d81190d871
15 changes: 0 additions & 15 deletions bigframes/dtypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -492,21 +492,6 @@ def cast_ibis_value(
)


def to_pandas_dtypes_overrides(schema: Iterable[bigquery.SchemaField]) -> Dict:
"""For each STRUCT field, make sure we specify the full type to use."""
# TODO(swast): Also override ARRAY fields.
dtypes = {}
for field in schema:
if field.field_type == "RECORD" and field.mode != "REPEATED":
# TODO(swast): We're using a private API here. Would likely be
# better if we called `to_arrow()` and converted to a pandas
# DataFrame ourselves from that.
dtypes[field.name] = pd.ArrowDtype(
gcb3p_pandas_helpers.bq_to_arrow_data_type(field)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this import is no longer used.

See lint error https://github.com/googleapis/python-bigquery-dataframes/actions/runs/8144793137

)
return dtypes


def is_dtype(scalar: typing.Any, dtype: Dtype) -> bool:
"""Captures whether a scalar can be losslessly represented by a dtype."""
if scalar is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ def test_create_single_timeseries(random_model_id):
print(evaluation)

# Inspect the coefficients of your model
f'''
'''

SELECT *
FROM ML.ARIMA_COEFFICIENTS(MODEL `{your_model_id}`)
'''

evaluation.ML.ARIMA_COEFFICIENTS()

'''
# Use your model to forecast the time series
#standardSQL
your_model_id.forecast()
ga_arima_model.predict(horizon= 30, confidence_level= 0.8)

# Explain and visualize the forecasting results
f'''
Expand Down