@@ -1625,6 +1625,9 @@ def from_glob_path(
1625
1625
) -> dataframe .DataFrame :
1626
1626
r"""Create a BigFrames DataFrame that contains a BigFrames Blob column from a global wildcard path.
1627
1627
1628
+ .. note::
1629
+ BigFrames Blob is still under experiments. It may not work and subject to change in the future.
1630
+
1628
1631
Args:
1629
1632
path (str):
1630
1633
The wildcard global path, such as "gs://<bucket>/<folder>/\*".
@@ -1641,6 +1644,7 @@ def from_glob_path(
1641
1644
if not bigframes .options .experiments .blob :
1642
1645
raise NotImplementedError ()
1643
1646
1647
+ # TODO(garrettwu): switch to pseudocolumn when b/374988109 is done.
1644
1648
connection = connection or self ._bq_connection
1645
1649
connection = bigframes .clients .resolve_full_bq_connection_name (
1646
1650
connection ,
@@ -1653,6 +1657,33 @@ def from_glob_path(
1653
1657
s = self .read_gbq (table )["uri" ].str .to_blob (connection )
1654
1658
return s .rename (name ).to_frame ()
1655
1659
1660
+ def read_gbq_object_table (
1661
+ self , object_table : str , * , name : Optional [str ] = None
1662
+ ) -> dataframe .DataFrame :
1663
+ """Read an existing object table to create a BigFrames Blob DataFrame. Use the connection of the object table for the connection of the blob.
1664
+ This function dosen't retrieve the object table data. If you want to read the data, use read_gbq() instead.
1665
+
1666
+ .. note::
1667
+ BigFrames Blob is still under experiments. It may not work and subject to change in the future.
1668
+
1669
+ Args:
1670
+ object_table (str): name of the object table of form <PROJECT_ID>.<DATASET_ID>.<TABLE_ID>.
1671
+ name (str or None): the returned blob column name.
1672
+
1673
+ Returns:
1674
+ bigframes.pandas.DataFrame:
1675
+ Result BigFrames DataFrame.
1676
+ """
1677
+ if not bigframes .options .experiments .blob :
1678
+ raise NotImplementedError ()
1679
+
1680
+ # TODO(garrettwu): switch to pseudocolumn when b/374988109 is done.
1681
+ table = self .bqclient .get_table (object_table )
1682
+ connection = table ._properties ["externalDataConfiguration" ]["connectionId" ]
1683
+
1684
+ s = self .read_gbq (object_table )["uri" ].str .to_blob (connection )
1685
+ return s .rename (name ).to_frame ()
1686
+
1656
1687
1657
1688
def connect (context : Optional [bigquery_options .BigQueryOptions ] = None ) -> Session :
1658
1689
return Session (context )
0 commit comments