Skip to content
Next Next commit
fix: use random table when loading data for read_csv, read_json, read…
…_parquet
  • Loading branch information
ashleyxuu committed Nov 3, 2023
commit 0f4de8190de82cc723fca1f16ca28c78a06aef5f
6 changes: 3 additions & 3 deletions bigframes/session/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,7 @@ def read_csv(
encoding: Optional[str] = None,
**kwargs,
) -> dataframe.DataFrame:
table = bigquery.Table(self._create_session_table())
table = bigframes_io.random_table(self._anonymous_dataset)

if engine is not None and engine == "bigquery":
if any(param is not None for param in (dtype, names)):
Expand Down Expand Up @@ -1140,7 +1140,7 @@ def read_parquet(
# Note: "engine" is omitted because it is redundant. Loading a table
# from a pandas DataFrame will just create another parquet file + load
# job anyway.
table = bigquery.Table(self._create_session_table())
table = bigframes_io.random_table(self._anonymous_dataset)

job_config = bigquery.LoadJobConfig()
job_config.create_disposition = bigquery.CreateDisposition.CREATE_IF_NEEDED
Expand All @@ -1163,7 +1163,7 @@ def read_json(
engine: Literal["ujson", "pyarrow", "bigquery"] = "ujson",
**kwargs,
) -> dataframe.DataFrame:
table = bigquery.Table(self._create_session_table())
table = bigframes_io.random_table(self._anonymous_dataset)

if engine == "bigquery":

Expand Down