From 254e363692df1cf7a77cf60f2bae8aed76e0c889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Swe=C3=B1a?= Date: Fri, 30 May 2025 16:06:27 -0500 Subject: [PATCH] docs: integrations notebook extracts token from `bqclient._http.credentials` instead of `bqclient._credentials` --- notebooks/dataframes/integrations.ipynb | 110 +++++++++++------------- 1 file changed, 49 insertions(+), 61 deletions(-) diff --git a/notebooks/dataframes/integrations.ipynb b/notebooks/dataframes/integrations.ipynb index 9edb174f18..8c7790b1ea 100644 --- a/notebooks/dataframes/integrations.ipynb +++ b/notebooks/dataframes/integrations.ipynb @@ -66,9 +66,21 @@ "name": "stderr", "output_type": "stream", "text": [ - "/usr/local/google/home/swast/src/bigframes-2/bigframes/core/global_session.py:113: DefaultLocationWarning: No explicit location is set, so using location US for the session.\n", - " return func(get_global_session(), *args, **kwargs)\n" + "/home/swast/src/github.com/googleapis/python-bigquery-dataframes/bigframes/core/global_session.py:103: DefaultLocationWarning: No explicit location is set, so using location US for the session.\n", + " _global_session = bigframes.session.connect(\n" ] + }, + { + "data": { + "text/html": [ + "Query job 1772ca28-2ef5-425c-87fe-8227aeb9318c is DONE. 0 Bytes processed. Open Job" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" } ], "source": [ @@ -96,13 +108,13 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "Query job eb7f3bbe-dda9-4d2f-b195-21de862d7055 is DONE. 0 Bytes processed. Open Job" + "Query job 33bd5814-b594-4ec4-baba-8f6b6e285e48 is DONE. 0 Bytes processed. Open Job" ], "text/plain": [ "" @@ -128,13 +140,13 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "Query job 4ad50c3c-91d0-4fef-91f6-0a2c5a30c38f is DONE. 0 Bytes processed. Open Job" + "Query job 1594d97a-1203-4c28-8730-caffb3ac4e9e is DONE. 0 Bytes processed. Open Job" ], "text/plain": [ "" @@ -146,10 +158,10 @@ { "data": { "text/plain": [ - "'swast-scratch._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20240710_sessionf75568_9a045ff143db4f8ab2018994287020f3'" + "'bigframes-dev._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20250530_session9fdc39_7578d5bd9949422599ccb9e4fe6451be'" ] }, - "execution_count": 7, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -172,13 +184,13 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "Query job 9e7d4b1a-d7fc-4599-bab4-40062c83288e is DONE. 0 Bytes processed. Open Job" + "Query job 8afc1538-9779-487a-a063-def5f438ee11 is DONE. 0 Bytes processed. Open Job" ], "text/plain": [ "" @@ -192,11 +204,11 @@ "output_type": "stream", "text": [ " index int_col float_col string_col\n", - "0 3 4 -0.1250 d\n", - "1 1 2 -0.5000 b\n", + "0 1 2 -0.5000 b\n", + "1 2 3 0.2500 c\n", "2 0 1 1.0000 a\n", - "3 4 5 0.0625 e\n", - "4 2 3 0.2500 c\n" + "3 3 4 -0.1250 d\n", + "4 4 5 0.0625 e\n" ] } ], @@ -238,13 +250,13 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "Query job 62db313e-7632-4dbb-8eff-5035d0e6c27e is DONE. 0 Bytes processed. Open Job" + "Query job b6f68a49-5129-448d-bca3-62a23dced10d is DONE. 0 Bytes processed. Open Job" ], "text/plain": [ "" @@ -258,11 +270,11 @@ "output_type": "stream", "text": [ " index int_col float_col string_col\n", - "0 1 2 -0.5000 b\n", - "1 3 4 -0.1250 d\n", - "2 0 1 1.0000 a\n", - "3 4 5 0.0625 e\n", - "4 2 3 0.2500 c\n" + "0 3 4 -0.1250 d\n", + "1 1 2 -0.5000 b\n", + "2 4 5 0.0625 e\n", + "3 2 3 0.2500 c\n", + "4 0 1 1.0000 a\n" ] } ], @@ -274,7 +286,7 @@ " table_id = df.to_gbq()\n", "\n", " bqclient = df.bqclient\n", - " token = bqclient._credentials.token\n", + " token = bqclient._http.credentials.token\n", " project_id = bqclient.project\n", "\n", " share_table_and_start_workload(table_id, token, project_id)\n", @@ -335,13 +347,13 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "Query job 1cbd8898-97c7-419e-87af-b72a9432afb6 is DONE. 0 Bytes processed. Open Job" + "Query job 0f205180-cf26-46e5-950d-109947b7f5a1 is DONE. 0 Bytes processed. Open Job" ], "text/plain": [ "" @@ -353,10 +365,10 @@ { "data": { "text/plain": [ - "'swast-scratch._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20240710_sessionf75568_58b9b6fc0c3349bf8d3dd6fb29ab5322'" + "'bigframes-dev._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20250530_session9fdc39_240520e0723548f18fd3bd5d24cbbf82'" ] }, - "execution_count": 9, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } @@ -378,13 +390,13 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ - "Query job 40e54aa9-fad7-47c3-9bec-144f6c7106d8 is DONE. 0 Bytes processed. Open Job" + "Query job 80177f9a-4f6e-4a4e-97db-f119ea686c62 is DONE. 0 Bytes processed. Open Job" ], "text/plain": [ "" @@ -396,10 +408,10 @@ { "data": { "text/plain": [ - "'swast-scratch._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20240710_sessionf75568_cdb4f54063b0417a8309c462b70239fa'" + "'bigframes-dev._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20250530_session9fdc39_4ca41d2f28f84feca1bbafe9304fd89f'" ] }, - "execution_count": 10, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } @@ -427,16 +439,16 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "Dataset(DatasetReference('swast-scratch', 'my_dataset'))" + "Dataset(DatasetReference('bigframes-dev', 'my_dataset'))" ] }, - "execution_count": 11, + "execution_count": 10, "metadata": {}, "output_type": "execute_result" } @@ -451,33 +463,9 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 11, "metadata": {}, "outputs": [ - { - "data": { - "text/html": [ - "Query job 73cf9e04-d5fa-4765-827c-665f0e6b9e00 is DONE. 0 Bytes processed. Open Job" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, - { - "data": { - "text/html": [ - "Query job b177eb37-197f-4732-8978-c74cccb36e01 is DONE. 270 Bytes processed. Open Job" - ], - "text/plain": [ - "" - ] - }, - "metadata": {}, - "output_type": "display_data" - }, { "data": { "text/html": [ @@ -593,7 +581,7 @@ "[10 rows x 3 columns]" ] }, - "execution_count": 12, + "execution_count": 11, "metadata": {}, "output_type": "execute_result" } @@ -683,7 +671,7 @@ ], "metadata": { "kernelspec": { - "display_name": "bigframes", + "display_name": "venv", "language": "python", "name": "python3" }, @@ -697,7 +685,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.12.10" } }, "nbformat": 4,