Skip to content

fix: default to 7 days expiration for read_csv, read_json, read_parquet #193

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 1 commit into from
Nov 10, 2023
Merged
Changes from all commits
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
11 changes: 10 additions & 1 deletion bigframes/session/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,11 +836,20 @@ def _read_bigquery_load_job(
)

self._start_generic_job(load_job)
table_id = f"{table.project}.{table.dataset_id}.{table.table_id}"

# Update the table expiration so we aren't limited to the default 24
# hours of the anonymous dataset.
table_expiration = bigquery.Table(table_id)
table_expiration.expires = (
datetime.datetime.now(datetime.timezone.utc) + constants.DEFAULT_EXPIRATION
)
self.bqclient.update_table(table_expiration, ["expires"])

# The BigQuery REST API for tables.get doesn't take a session ID, so we
# can't get the schema for a temp table that way.
return self.read_gbq_table(
f"{table.project}.{table.dataset_id}.{table.table_id}",
table_id,
index_col=index_col,
col_order=col_order,
)
Expand Down