Skip to content

Commit 7261a4e

Browse files
authored
feat: add deprecation warnings for .blob accessor and read_gbq_object_table (#2408)
This PR introduces ApiDeprecationWarning (which inherits from FutureWarning) to the following APIs to notify users of their upcoming removal in a future release: - `Series.blob` accessor: Added a warning to the property getter in bigframes/series.py. - `read_gbq_object_table`: Added a warning to the implementation in bigframes/session/Session. This will also trigger when called via bigframes.pandas.read_gbq_object_table. Fixes #<478952368> 🦕
1 parent a80ac3f commit 7261a4e

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

bigframes/series.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,14 @@ def list(self) -> lists.ListAccessor:
317317

318318
@property
319319
def blob(self) -> blob.BlobAccessor:
320+
"""
321+
Accessor for Blob operations.
322+
"""
323+
warnings.warn(
324+
"The blob accessor is deprecated and will be removed in a future release. Use bigframes.bigquery.obj functions instead.",
325+
category=bfe.ApiDeprecationWarning,
326+
stacklevel=2,
327+
)
320328
return blob.BlobAccessor(self)
321329

322330
@property

bigframes/session/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2291,6 +2291,11 @@ def read_gbq_object_table(
22912291
bigframes.pandas.DataFrame:
22922292
Result BigFrames DataFrame.
22932293
"""
2294+
warnings.warn(
2295+
"read_gbq_object_table is deprecated and will be removed in a future release. Use read_gbq with 'ref' column instead.",
2296+
category=bfe.ApiDeprecationWarning,
2297+
stacklevel=2,
2298+
)
22942299
# TODO(garrettwu): switch to pseudocolumn when b/374988109 is done.
22952300
table = self.bqclient.get_table(object_table)
22962301
connection = table._properties["externalDataConfiguration"]["connectionId"]

0 commit comments

Comments
 (0)