Skip to content

Commit 0591d7a

Browse files
committed
add a check for index display
1 parent a5bd541 commit 0591d7a

File tree

3 files changed

+89
-82
lines changed

3 files changed

+89
-82
lines changed

bigframes/display/anywidget.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ def _set_table_html(self) -> None:
297297
page_data = cached_data.iloc[start:end].copy()
298298

299299
# Handle index display
300-
if page_data.index.name is not None:
300+
if self._dataframe._block.has_index and page_data.index.name is not None:
301301
# Custom named index - include it with its actual name
302302
page_data.insert(0, page_data.index.name, page_data.index)
303303
else:

notebooks/dataframes/anywidget_mode.ipynb

Lines changed: 75 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,16 @@
107107
"output_type": "stream",
108108
"text": [
109109
"state gender year name number\n",
110-
" AL F 1910 Sadie 40\n",
111-
" AL F 1910 Mary 875\n",
112-
" AR F 1910 Vera 39\n",
113-
" AR F 1910 Marie 78\n",
114-
" AR F 1910 Lucille 66\n",
115-
" CA F 1910 Virginia 101\n",
116-
" DC F 1910 Margaret 72\n",
117-
" GA F 1910 Mildred 133\n",
118-
" GA F 1910 Vera 51\n",
119-
" GA F 1910 Sallie 92\n",
110+
" AL F 1910 Vera 71\n",
111+
" AR F 1910 Viola 37\n",
112+
" AR F 1910 Alice 57\n",
113+
" AR F 1910 Edna 95\n",
114+
" AR F 1910 Ollie 40\n",
115+
" CA F 1910 Beatrice 37\n",
116+
" CT F 1910 Marion 36\n",
117+
" CT F 1910 Marie 36\n",
118+
" FL F 1910 Alice 53\n",
119+
" GA F 1910 Thelma 133\n",
120120
"...\n",
121121
"\n",
122122
"[5552452 rows x 5 columns]\n"
@@ -196,7 +196,7 @@
196196
{
197197
"data": {
198198
"application/vnd.jupyter.widget-view+json": {
199-
"model_id": "0b33d569070e4e04b26366b554f9f7ca",
199+
"model_id": "0eed2201e13d496ab741662d96eddc14",
200200
"version_major": 2,
201201
"version_minor": 1
202202
},
@@ -409,12 +409,12 @@
409409
{
410410
"data": {
411411
"application/vnd.jupyter.widget-view+json": {
412-
"model_id": "5d53673f0d8d47a5b2990d7f638c227a",
412+
"model_id": "45766d5dd61744c2a1c2448b8eddc86d",
413413
"version_major": 2,
414414
"version_minor": 1
415415
},
416416
"text/plain": [
417-
"<bigframes.display.anywidget.TableWidget object at 0x7f198780b890>"
417+
"<bigframes.display.anywidget.TableWidget object at 0x7fa2cdb07750>"
418418
]
419419
},
420420
"execution_count": 7,
@@ -523,12 +523,12 @@
523523
{
524524
"data": {
525525
"application/vnd.jupyter.widget-view+json": {
526-
"model_id": "3e766645154d4208b974f0a6dc2d72bf",
526+
"model_id": "cf835e468a03459f9bd2df0f1a3979ed",
527527
"version_major": 2,
528528
"version_minor": 1
529529
},
530530
"text/plain": [
531-
"<bigframes.display.anywidget.TableWidget object at 0x7f1984718690>"
531+
"<bigframes.display.anywidget.TableWidget object at 0x7fa2cc0fc550>"
532532
]
533533
},
534534
"execution_count": 9,
@@ -563,7 +563,7 @@
563563
"data": {
564564
"text/html": [
565565
"✅ Completed. \n",
566-
" Query processed 85.9 kB in 13 seconds of slot time.\n",
566+
" Query processed 85.9 kB in 18 seconds of slot time.\n",
567567
" "
568568
],
569569
"text/plain": [
@@ -624,7 +624,7 @@
624624
{
625625
"data": {
626626
"application/vnd.jupyter.widget-view+json": {
627-
"model_id": "076edd86ebb9473eab4dfa2b7deb70f3",
627+
"model_id": "39a3ce333e8b4e13aa69fca9c0a08a4e",
628628
"version_major": 2,
629629
"version_minor": 1
630630
},
@@ -671,42 +671,6 @@
671671
" <td>gs://gcs-public-data--labeled-patents/espacene...</td>\n",
672672
" <td>EU</td>\n",
673673
" <td>DE</td>\n",
674-
" <td>29.08.018</td>\n",
675-
" <td>E04H 6/12</td>\n",
676-
" <td>&lt;NA&gt;</td>\n",
677-
" <td>18157874.1</td>\n",
678-
" <td>21.02.2018</td>\n",
679-
" <td>22.02.2017</td>\n",
680-
" <td>Liedtke &amp; Partner Patentanw√§lte</td>\n",
681-
" <td>SHB Hebezeugbau GmbH</td>\n",
682-
" <td>VOLGER, Alexander</td>\n",
683-
" <td>STEUERUNGSSYSTEM FÜR AUTOMATISCHE PARKHÄUSER</td>\n",
684-
" <td>EP 3 366 869 A1</td>\n",
685-
" </tr>\n",
686-
" <tr>\n",
687-
" <th>1</th>\n",
688-
" <td>{'application_number': None, 'class_internatio...</td>\n",
689-
" <td>gs://gcs-public-data--labeled-patents/espacene...</td>\n",
690-
" <td>EU</td>\n",
691-
" <td>DE</td>\n",
692-
" <td>03.10.2018</td>\n",
693-
" <td>H05B 6/12</td>\n",
694-
" <td>&lt;NA&gt;</td>\n",
695-
" <td>18165514.3</td>\n",
696-
" <td>03.04.2018</td>\n",
697-
" <td>30.03.2017</td>\n",
698-
" <td>&lt;NA&gt;</td>\n",
699-
" <td>BSH Hausger√§te GmbH</td>\n",
700-
" <td>Acero Acero, Jesus</td>\n",
701-
" <td>VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG</td>\n",
702-
" <td>EP 3 383 141 A2</td>\n",
703-
" </tr>\n",
704-
" <tr>\n",
705-
" <th>2</th>\n",
706-
" <td>{'application_number': None, 'class_internatio...</td>\n",
707-
" <td>gs://gcs-public-data--labeled-patents/espacene...</td>\n",
708-
" <td>EU</td>\n",
709-
" <td>DE</td>\n",
710674
" <td>03.10.2018</td>\n",
711675
" <td>H01L 21/20</td>\n",
712676
" <td>&lt;NA&gt;</td>\n",
@@ -720,7 +684,7 @@
720684
" <td>EP 3 382 744 A1</td>\n",
721685
" </tr>\n",
722686
" <tr>\n",
723-
" <th>3</th>\n",
687+
" <th>1</th>\n",
724688
" <td>{'application_number': None, 'class_internatio...</td>\n",
725689
" <td>gs://gcs-public-data--labeled-patents/espacene...</td>\n",
726690
" <td>EU</td>\n",
@@ -738,7 +702,25 @@
738702
" <td>EP 3 382 553 A1</td>\n",
739703
" </tr>\n",
740704
" <tr>\n",
741-
" <th>4</th>\n",
705+
" <th>2</th>\n",
706+
" <td>{'application_number': None, 'class_internatio...</td>\n",
707+
" <td>gs://gcs-public-data--labeled-patents/espacene...</td>\n",
708+
" <td>EU</td>\n",
709+
" <td>DE</td>\n",
710+
" <td>29.08.018</td>\n",
711+
" <td>E04H 6/12</td>\n",
712+
" <td>&lt;NA&gt;</td>\n",
713+
" <td>18157874.1</td>\n",
714+
" <td>21.02.2018</td>\n",
715+
" <td>22.02.2017</td>\n",
716+
" <td>Liedtke &amp; Partner Patentanw√§lte</td>\n",
717+
" <td>SHB Hebezeugbau GmbH</td>\n",
718+
" <td>VOLGER, Alexander</td>\n",
719+
" <td>STEUERUNGSSYSTEM FÜR AUTOMATISCHE PARKHÄUSER</td>\n",
720+
" <td>EP 3 366 869 A1</td>\n",
721+
" </tr>\n",
722+
" <tr>\n",
723+
" <th>3</th>\n",
742724
" <td>{'application_number': None, 'class_internatio...</td>\n",
743725
" <td>gs://gcs-public-data--labeled-patents/espacene...</td>\n",
744726
" <td>EU</td>\n",
@@ -755,6 +737,24 @@
755737
" <td>MASTHÄHNCHENCONTAINER ALS BESTANDTEIL EINER E...</td>\n",
756738
" <td>EP 3 381 276 A1</td>\n",
757739
" </tr>\n",
740+
" <tr>\n",
741+
" <th>4</th>\n",
742+
" <td>{'application_number': None, 'class_internatio...</td>\n",
743+
" <td>gs://gcs-public-data--labeled-patents/espacene...</td>\n",
744+
" <td>EU</td>\n",
745+
" <td>DE</td>\n",
746+
" <td>03.10.2018</td>\n",
747+
" <td>H05B 6/12</td>\n",
748+
" <td>&lt;NA&gt;</td>\n",
749+
" <td>18165514.3</td>\n",
750+
" <td>03.04.2018</td>\n",
751+
" <td>30.03.2017</td>\n",
752+
" <td>&lt;NA&gt;</td>\n",
753+
" <td>BSH Hausger√§te GmbH</td>\n",
754+
" <td>Acero Acero, Jesus</td>\n",
755+
" <td>VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG</td>\n",
756+
" <td>EP 3 383 141 A2</td>\n",
757+
" </tr>\n",
758758
" </tbody>\n",
759759
"</table>\n",
760760
"<p>5 rows × 15 columns</p>\n",
@@ -776,32 +776,32 @@
776776
"4 gs://gcs-public-data--labeled-patents/espacene... EU DE \n",
777777
"\n",
778778
" publication_date class_international class_us application_number \\\n",
779-
"0 29.08.018 E04H 6/12 <NA> 18157874.1 \n",
780-
"1 03.10.2018 H05B 6/12 <NA> 18165514.3 \n",
781-
"2 03.10.2018 H01L 21/20 <NA> 18166536.5 \n",
782-
"3 03.10.2018 G06F 11/30 <NA> 18157347.8 \n",
783-
"4 03.10.2018 A01K 31/00 <NA> 18171005.4 \n",
779+
"0 03.10.2018 H01L 21/20 <NA> 18166536.5 \n",
780+
"1 03.10.2018 G06F 11/30 <NA> 18157347.8 \n",
781+
"2 29.08.018 E04H 6/12 <NA> 18157874.1 \n",
782+
"3 03.10.2018 A01K 31/00 <NA> 18171005.4 \n",
783+
"4 03.10.2018 H05B 6/12 <NA> 18165514.3 \n",
784784
"\n",
785785
" filing_date priority_date_eu representative_line_1_eu \\\n",
786-
"0 21.02.2018 22.02.2017 Liedtke & Partner Patentanw√§lte \n",
787-
"1 03.04.2018 30.03.2017 <NA> \n",
788-
"2 16.02.2016 <NA> Scheider, Sascha et al \n",
789-
"3 19.02.2018 31.03.2017 Hoffmann Eitle \n",
790-
"4 05.02.2015 05.02.2014 Stork Bamberger Patentanw√§lte \n",
786+
"0 16.02.2016 <NA> Scheider, Sascha et al \n",
787+
"1 19.02.2018 31.03.2017 Hoffmann Eitle \n",
788+
"2 21.02.2018 22.02.2017 Liedtke & Partner Patentanw√§lte \n",
789+
"3 05.02.2015 05.02.2014 Stork Bamberger Patentanw√§lte \n",
790+
"4 03.04.2018 30.03.2017 <NA> \n",
791791
"\n",
792792
" applicant_line_1 inventor_line_1 \\\n",
793-
"0 SHB Hebezeugbau GmbH VOLGER, Alexander \n",
794-
"1 BSH Hausger√§te GmbH Acero Acero, Jesus \n",
795-
"2 EV Group E. Thallner GmbH Kurz, Florian \n",
796-
"3 FUJITSU LIMITED Kukihara, Kensuke \n",
797-
"4 Linco Food Systems A/S Thrane, Uffe \n",
793+
"0 EV Group E. Thallner GmbH Kurz, Florian \n",
794+
"1 FUJITSU LIMITED Kukihara, Kensuke \n",
795+
"2 SHB Hebezeugbau GmbH VOLGER, Alexander \n",
796+
"3 Linco Food Systems A/S Thrane, Uffe \n",
797+
"4 BSH Hausger√§te GmbH Acero Acero, Jesus \n",
798798
"\n",
799799
" title_line_1 number \n",
800-
"0 STEUERUNGSSYSTEM FÜR AUTOMATISCHE PARKHÄUSER EP 3 366 869 A1 \n",
801-
"1 VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG EP 3 383 141 A2 \n",
802-
"2 VORRICHTUNG ZUM BONDEN VON SUBSTRATEN EP 3 382 744 A1 \n",
803-
"3 METHOD EXECUTED BY A COMPUTER, INFORMATION PRO... EP 3 382 553 A1 \n",
804-
"4 MASTHÄHNCHENCONTAINER ALS BESTANDTEIL EINER E... EP 3 381 276 A1 \n",
800+
"0 VORRICHTUNG ZUM BONDEN VON SUBSTRATEN EP 3 382 744 A1 \n",
801+
"1 METHOD EXECUTED BY A COMPUTER, INFORMATION PRO... EP 3 382 553 A1 \n",
802+
"2 STEUERUNGSSYSTEM FÜR AUTOMATISCHE PARKHÄUSER EP 3 366 869 A1 \n",
803+
"3 MASTHÄHNCHENCONTAINER ALS BESTANDTEIL EINER E... EP 3 381 276 A1 \n",
804+
"4 VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG EP 3 383 141 A2 \n",
805805
"\n",
806806
"[5 rows x 15 columns]"
807807
]

noxfile.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@
6666

6767
UNIT_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
6868
UNIT_TEST_STANDARD_DEPENDENCIES = [
69-
"mock",
70-
"asyncmock",
7169
PYTEST_VERSION,
7270
"pytest-asyncio",
7371
"pytest-cov",
@@ -92,7 +90,6 @@
9290
SYSTEM_TEST_PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
9391
SYSTEM_TEST_STANDARD_DEPENDENCIES = [
9492
"jinja2",
95-
"mock",
9693
"openpyxl",
9794
PYTEST_VERSION,
9895
"pytest-cov",
@@ -207,7 +204,10 @@ def lint_setup_py(session):
207204

208205
def install_unittest_dependencies(session, install_test_extra, *constraints):
209206
standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
210-
session.install(*standard_deps, *constraints)
207+
session.install("setuptools", "wheel")
208+
session.install(
209+
"--extra-index-url", "https://pypi.org/simple/", *standard_deps, *constraints
210+
)
211211

212212
if UNIT_TEST_LOCAL_DEPENDENCIES:
213213
session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints)
@@ -224,6 +224,7 @@ def install_unittest_dependencies(session, install_test_extra, *constraints):
224224

225225
def run_unit(session, install_test_extra):
226226
"""Run the unit test suite."""
227+
session.env["PIP_EXTRA_INDEX_URL"] = "https://pypi.org/simple/"
227228
constraints_path = str(
228229
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
229230
)
@@ -313,7 +314,13 @@ def install_systemtest_dependencies(session, install_test_extra, *constraints):
313314
# See https://github.com/grpc/grpc/pull/30642
314315
session.install("--pre", "grpcio!=1.49.0rc1")
315316

316-
session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints)
317+
session.install("setuptools", "wheel")
318+
session.install(
319+
"--extra-index-url",
320+
"https://pypi.org/simple/",
321+
*SYSTEM_TEST_STANDARD_DEPENDENCIES,
322+
*constraints,
323+
)
317324

318325
if SYSTEM_TEST_EXTERNAL_DEPENDENCIES:
319326
session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints)
@@ -349,7 +356,7 @@ def run_system(
349356
timeout_seconds=900,
350357
num_workers=20,
351358
):
352-
"""Run the system test suite."""
359+
session.env["PIP_EXTRA_INDEX_URL"] = "https://pypi.org/simple/"
353360
constraints_path = str(
354361
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
355362
)

0 commit comments

Comments
 (0)