Skip to content

Commit 6e63eca

Browse files
authored
docs: integrations notebook extracts token from bqclient._http.credentials instead of bqclient._credentials (#1784)
1 parent 734cc65 commit 6e63eca

File tree

1 file changed

+49
-61
lines changed

1 file changed

+49
-61
lines changed

notebooks/dataframes/integrations.ipynb

Lines changed: 49 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,21 @@
6666
"name": "stderr",
6767
"output_type": "stream",
6868
"text": [
69-
"/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",
70-
" return func(get_global_session(), *args, **kwargs)\n"
69+
"/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",
70+
" _global_session = bigframes.session.connect(\n"
7171
]
72+
},
73+
{
74+
"data": {
75+
"text/html": [
76+
"Query job 1772ca28-2ef5-425c-87fe-8227aeb9318c is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:1772ca28-2ef5-425c-87fe-8227aeb9318c&page=queryresults\">Open Job</a>"
77+
],
78+
"text/plain": [
79+
"<IPython.core.display.HTML object>"
80+
]
81+
},
82+
"metadata": {},
83+
"output_type": "display_data"
7284
}
7385
],
7486
"source": [
@@ -96,13 +108,13 @@
96108
},
97109
{
98110
"cell_type": "code",
99-
"execution_count": 6,
111+
"execution_count": 4,
100112
"metadata": {},
101113
"outputs": [
102114
{
103115
"data": {
104116
"text/html": [
105-
"Query job eb7f3bbe-dda9-4d2f-b195-21de862d7055 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:eb7f3bbe-dda9-4d2f-b195-21de862d7055&page=queryresults\">Open Job</a>"
117+
"Query job 33bd5814-b594-4ec4-baba-8f6b6e285e48 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:33bd5814-b594-4ec4-baba-8f6b6e285e48&page=queryresults\">Open Job</a>"
106118
],
107119
"text/plain": [
108120
"<IPython.core.display.HTML object>"
@@ -128,13 +140,13 @@
128140
},
129141
{
130142
"cell_type": "code",
131-
"execution_count": 7,
143+
"execution_count": 5,
132144
"metadata": {},
133145
"outputs": [
134146
{
135147
"data": {
136148
"text/html": [
137-
"Query job 4ad50c3c-91d0-4fef-91f6-0a2c5a30c38f is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:4ad50c3c-91d0-4fef-91f6-0a2c5a30c38f&page=queryresults\">Open Job</a>"
149+
"Query job 1594d97a-1203-4c28-8730-caffb3ac4e9e is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:1594d97a-1203-4c28-8730-caffb3ac4e9e&page=queryresults\">Open Job</a>"
138150
],
139151
"text/plain": [
140152
"<IPython.core.display.HTML object>"
@@ -146,10 +158,10 @@
146158
{
147159
"data": {
148160
"text/plain": [
149-
"'swast-scratch._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20240710_sessionf75568_9a045ff143db4f8ab2018994287020f3'"
161+
"'bigframes-dev._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20250530_session9fdc39_7578d5bd9949422599ccb9e4fe6451be'"
150162
]
151163
},
152-
"execution_count": 7,
164+
"execution_count": 5,
153165
"metadata": {},
154166
"output_type": "execute_result"
155167
}
@@ -172,13 +184,13 @@
172184
},
173185
{
174186
"cell_type": "code",
175-
"execution_count": null,
187+
"execution_count": 6,
176188
"metadata": {},
177189
"outputs": [
178190
{
179191
"data": {
180192
"text/html": [
181-
"Query job 9e7d4b1a-d7fc-4599-bab4-40062c83288e is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:9e7d4b1a-d7fc-4599-bab4-40062c83288e&page=queryresults\">Open Job</a>"
193+
"Query job 8afc1538-9779-487a-a063-def5f438ee11 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:8afc1538-9779-487a-a063-def5f438ee11&page=queryresults\">Open Job</a>"
182194
],
183195
"text/plain": [
184196
"<IPython.core.display.HTML object>"
@@ -192,11 +204,11 @@
192204
"output_type": "stream",
193205
"text": [
194206
" index int_col float_col string_col\n",
195-
"0 3 4 -0.1250 d\n",
196-
"1 1 2 -0.5000 b\n",
207+
"0 1 2 -0.5000 b\n",
208+
"1 2 3 0.2500 c\n",
197209
"2 0 1 1.0000 a\n",
198-
"3 4 5 0.0625 e\n",
199-
"4 2 3 0.2500 c\n"
210+
"3 3 4 -0.1250 d\n",
211+
"4 4 5 0.0625 e\n"
200212
]
201213
}
202214
],
@@ -238,13 +250,13 @@
238250
},
239251
{
240252
"cell_type": "code",
241-
"execution_count": 8,
253+
"execution_count": 7,
242254
"metadata": {},
243255
"outputs": [
244256
{
245257
"data": {
246258
"text/html": [
247-
"Query job 62db313e-7632-4dbb-8eff-5035d0e6c27e is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:62db313e-7632-4dbb-8eff-5035d0e6c27e&page=queryresults\">Open Job</a>"
259+
"Query job b6f68a49-5129-448d-bca3-62a23dced10d is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:b6f68a49-5129-448d-bca3-62a23dced10d&page=queryresults\">Open Job</a>"
248260
],
249261
"text/plain": [
250262
"<IPython.core.display.HTML object>"
@@ -258,11 +270,11 @@
258270
"output_type": "stream",
259271
"text": [
260272
" index int_col float_col string_col\n",
261-
"0 1 2 -0.5000 b\n",
262-
"1 3 4 -0.1250 d\n",
263-
"2 0 1 1.0000 a\n",
264-
"3 4 5 0.0625 e\n",
265-
"4 2 3 0.2500 c\n"
273+
"0 3 4 -0.1250 d\n",
274+
"1 1 2 -0.5000 b\n",
275+
"2 4 5 0.0625 e\n",
276+
"3 2 3 0.2500 c\n",
277+
"4 0 1 1.0000 a\n"
266278
]
267279
}
268280
],
@@ -274,7 +286,7 @@
274286
" table_id = df.to_gbq()\n",
275287
"\n",
276288
" bqclient = df.bqclient\n",
277-
" token = bqclient._credentials.token\n",
289+
" token = bqclient._http.credentials.token\n",
278290
" project_id = bqclient.project\n",
279291
"\n",
280292
" share_table_and_start_workload(table_id, token, project_id)\n",
@@ -335,13 +347,13 @@
335347
},
336348
{
337349
"cell_type": "code",
338-
"execution_count": 9,
350+
"execution_count": 8,
339351
"metadata": {},
340352
"outputs": [
341353
{
342354
"data": {
343355
"text/html": [
344-
"Query job 1cbd8898-97c7-419e-87af-b72a9432afb6 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:1cbd8898-97c7-419e-87af-b72a9432afb6&page=queryresults\">Open Job</a>"
356+
"Query job 0f205180-cf26-46e5-950d-109947b7f5a1 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:0f205180-cf26-46e5-950d-109947b7f5a1&page=queryresults\">Open Job</a>"
345357
],
346358
"text/plain": [
347359
"<IPython.core.display.HTML object>"
@@ -353,10 +365,10 @@
353365
{
354366
"data": {
355367
"text/plain": [
356-
"'swast-scratch._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20240710_sessionf75568_58b9b6fc0c3349bf8d3dd6fb29ab5322'"
368+
"'bigframes-dev._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20250530_session9fdc39_240520e0723548f18fd3bd5d24cbbf82'"
357369
]
358370
},
359-
"execution_count": 9,
371+
"execution_count": 8,
360372
"metadata": {},
361373
"output_type": "execute_result"
362374
}
@@ -378,13 +390,13 @@
378390
},
379391
{
380392
"cell_type": "code",
381-
"execution_count": 10,
393+
"execution_count": 9,
382394
"metadata": {},
383395
"outputs": [
384396
{
385397
"data": {
386398
"text/html": [
387-
"Query job 40e54aa9-fad7-47c3-9bec-144f6c7106d8 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:40e54aa9-fad7-47c3-9bec-144f6c7106d8&page=queryresults\">Open Job</a>"
399+
"Query job 80177f9a-4f6e-4a4e-97db-f119ea686c62 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=bigframes-dev&j=bq:US:80177f9a-4f6e-4a4e-97db-f119ea686c62&page=queryresults\">Open Job</a>"
388400
],
389401
"text/plain": [
390402
"<IPython.core.display.HTML object>"
@@ -396,10 +408,10 @@
396408
{
397409
"data": {
398410
"text/plain": [
399-
"'swast-scratch._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20240710_sessionf75568_cdb4f54063b0417a8309c462b70239fa'"
411+
"'bigframes-dev._63cfa399614a54153cc386c27d6c0c6fdb249f9e.bqdf20250530_session9fdc39_4ca41d2f28f84feca1bbafe9304fd89f'"
400412
]
401413
},
402-
"execution_count": 10,
414+
"execution_count": 9,
403415
"metadata": {},
404416
"output_type": "execute_result"
405417
}
@@ -427,16 +439,16 @@
427439
},
428440
{
429441
"cell_type": "code",
430-
"execution_count": 11,
442+
"execution_count": 10,
431443
"metadata": {},
432444
"outputs": [
433445
{
434446
"data": {
435447
"text/plain": [
436-
"Dataset(DatasetReference('swast-scratch', 'my_dataset'))"
448+
"Dataset(DatasetReference('bigframes-dev', 'my_dataset'))"
437449
]
438450
},
439-
"execution_count": 11,
451+
"execution_count": 10,
440452
"metadata": {},
441453
"output_type": "execute_result"
442454
}
@@ -451,33 +463,9 @@
451463
},
452464
{
453465
"cell_type": "code",
454-
"execution_count": 12,
466+
"execution_count": 11,
455467
"metadata": {},
456468
"outputs": [
457-
{
458-
"data": {
459-
"text/html": [
460-
"Query job 73cf9e04-d5fa-4765-827c-665f0e6b9e00 is DONE. 0 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:73cf9e04-d5fa-4765-827c-665f0e6b9e00&page=queryresults\">Open Job</a>"
461-
],
462-
"text/plain": [
463-
"<IPython.core.display.HTML object>"
464-
]
465-
},
466-
"metadata": {},
467-
"output_type": "display_data"
468-
},
469-
{
470-
"data": {
471-
"text/html": [
472-
"Query job b177eb37-197f-4732-8978-c74cccb36e01 is DONE. 270 Bytes processed. <a target=\"_blank\" href=\"https://console.cloud.google.com/bigquery?project=swast-scratch&j=bq:US:b177eb37-197f-4732-8978-c74cccb36e01&page=queryresults\">Open Job</a>"
473-
],
474-
"text/plain": [
475-
"<IPython.core.display.HTML object>"
476-
]
477-
},
478-
"metadata": {},
479-
"output_type": "display_data"
480-
},
481469
{
482470
"data": {
483471
"text/html": [
@@ -593,7 +581,7 @@
593581
"[10 rows x 3 columns]"
594582
]
595583
},
596-
"execution_count": 12,
584+
"execution_count": 11,
597585
"metadata": {},
598586
"output_type": "execute_result"
599587
}
@@ -683,7 +671,7 @@
683671
],
684672
"metadata": {
685673
"kernelspec": {
686-
"display_name": "bigframes",
674+
"display_name": "venv",
687675
"language": "python",
688676
"name": "python3"
689677
},
@@ -697,7 +685,7 @@
697685
"name": "python",
698686
"nbconvert_exporter": "python",
699687
"pygments_lexer": "ipython3",
700-
"version": "3.10.9"
688+
"version": "3.12.10"
701689
}
702690
},
703691
"nbformat": 4,

0 commit comments

Comments
 (0)