Skip to content

Commit 36693bf

Browse files
authored
feat!: rename bigframes.pandas.reset_session to close_session (#101)
1 parent e325fbb commit 36693bf

File tree

13 files changed

+25
-25
lines changed

13 files changed

+25
-25
lines changed

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ auto-populates ``bf.options.bigquery.location`` if the user starts with
6363
directly or in a SQL statement.
6464

6565
If you want to reset the location of the created DataFrame or Series objects,
66-
you can reset the session by executing ``bigframes.pandas.reset_session()``.
66+
you can close the session by executing ``bigframes.pandas.close_session()``.
6767
After that, you can reuse ``bigframes.pandas.options.bigquery.location`` to
6868
specify another location.
6969

@@ -335,7 +335,7 @@ sessions
335335
; when this happens, you can’t use previously
336336
created DataFrame or Series objects and must re-create them using a new
337337
BigQuery DataFrames session. You can do this by running
338-
``bigframes.pandas.reset_session()`` and then re-running the BigQuery
338+
``bigframes.pandas.close_session()`` and then re-running the BigQuery
339339
DataFrames expressions.
340340

341341

bigframes/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

1717
from bigframes._config import options
1818
from bigframes._config.bigquery_options import BigQueryOptions
19-
from bigframes.core.global_session import get_global_session, reset_session
19+
from bigframes.core.global_session import close_session, get_global_session
2020
from bigframes.session import connect, Session
2121
from bigframes.version import __version__
2222

2323
__all__ = [
2424
"options",
2525
"BigQueryOptions",
2626
"get_global_session",
27-
"reset_session",
27+
"close_session",
2828
"connect",
2929
"Session",
3030
"__version__",

bigframes/_config/bigquery_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
SESSION_STARTED_MESSAGE = (
2525
"Cannot change '{attribute}' once a session has started. "
26-
"Call bigframes.pandas.reset_session() first, if you are using the bigframes.pandas API."
26+
"Call bigframes.pandas.close_session() first, if you are using the bigframes.pandas API."
2727
)
2828

2929

bigframes/core/global_session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
_global_session_lock = threading.Lock()
2525

2626

27-
def reset_session() -> None:
27+
def close_session() -> None:
2828
"""Start a fresh session the next time a function requires a session.
2929
3030
Closes the current session if it was already started.

bigframes/pandas/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def read_gbq_function(function_name: str):
447447

448448
# Session management APIs
449449
get_global_session = global_session.get_global_session
450-
reset_session = global_session.reset_session
450+
close_session = global_session.close_session
451451

452452

453453
# Use __all__ to let type checkers know what is part of the public API.
@@ -478,5 +478,5 @@ def read_gbq_function(function_name: str):
478478
"options",
479479
# Session management APIs
480480
"get_global_session",
481-
"reset_session",
481+
"close_session",
482482
]

notebooks/generative_ai/bq_dataframes_llm_code_generation.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
"id": "DTVtFlqeFbrU"
355355
},
356356
"source": [
357-
"If you want to reset the location of the created DataFrame or Series objects, reset the session by executing `bf.reset_session()`. After that, you can reuse `bf.options.bigquery.location` to specify another location."
357+
"If you want to reset the location of the created DataFrame or Series objects, reset the session by executing `bf.close_session()`. After that, you can reuse `bf.options.bigquery.location` to specify another location."
358358
]
359359
},
360360
{

notebooks/getting_started/getting_started_bq_dataframes.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@
383383
"id": "pDfrKwMKE_dK"
384384
},
385385
"source": [
386-
"If you want to reset the location of the created DataFrame or Series objects, reset the session by executing `bf.reset_session()`. After that, you can reuse `bf.options.bigquery.location` to specify another location."
386+
"If you want to reset the location of the created DataFrame or Series objects, reset the session by executing `bf.close_session()`. After that, you can reuse `bf.options.bigquery.location` to specify another location."
387387
]
388388
},
389389
{

notebooks/regression/bq_dataframes_ml_linear_regression.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@
370370
"id": "D21CoOlfFTYI"
371371
},
372372
"source": [
373-
"If you want to reset the location of the created DataFrame or Series objects, reset the session by executing `bf.reset_session()`. After that, you can reuse `bf.options.bigquery.location` to specify another location."
373+
"If you want to reset the location of the created DataFrame or Series objects, reset the session by executing `bf.close_session()`. After that, you can reuse `bf.options.bigquery.location` to specify another location."
374374
]
375375
},
376376
{

samples/snippets/quickstart_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_quickstart(
2323
capsys: pytest.CaptureFixture[str],
2424
) -> None:
2525
# We need a fresh session since we're modifying connection options.
26-
bigframes.pandas.reset_session()
26+
bigframes.pandas.close_session()
2727

2828
# TODO(swast): Get project from environment so contributors can run tests.
2929
quickstart.run_quickstart("bigframes-dev")

samples/snippets/remote_function_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_remote_function_and_read_gbq_function(
2323
capsys: pytest.CaptureFixture[str],
2424
) -> None:
2525
# We need a fresh session since we're modifying connection options.
26-
bigframes.pandas.reset_session()
26+
bigframes.pandas.close_session()
2727

2828
# TODO(swast): Get project from environment so contributors can run tests.
2929
remote_function.run_remote_function_and_read_gbq_function("bigframes-dev")

0 commit comments

Comments
 (0)