Skip to content

Commit 36c359d

Browse files
authored
feat: add bpd.options.reset() method (#1743)
* feat: add bpd.options.reset() method * reset experimental flag
1 parent d451aef commit 36c359d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

bigframes/_config/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,21 @@ class Options:
5656
"""Global options affecting BigQuery DataFrames behavior."""
5757

5858
def __init__(self):
59+
self.reset()
60+
61+
def reset(self) -> Options:
62+
"""Reset the option settings to defaults.
63+
64+
Returns:
65+
bigframes._config.Options: Options object with default values.
66+
"""
5967
self._local = ThreadLocalConfig()
6068

6169
# BigQuery options are special because they can only be set once per
6270
# session, so we need an indicator as to whether we are using the
6371
# thread-local session or the global session.
6472
self._bigquery_options = bigquery_options.BigQueryOptions()
73+
return self
6574

6675
def _init_bigquery_thread_local(self):
6776
"""Initialize thread-local options, based on current global options."""

samples/snippets/quickstart.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ def run_quickstart(project_id: str) -> None:
7474

7575
# close session and reset option so not to affect other tests
7676
bpd.close_session()
77-
bpd.options.bigquery.ordering_mode = "strict"
77+
bpd.options.reset()

0 commit comments

Comments
 (0)