"
- ]
- },
- "metadata": {},
- "output_type": "display_data"
- },
- {
- "name": "stderr",
- "output_type": "stream",
- "text": [
- "/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/dtypes.py:987: JSONDtypeWarning: JSON columns will be represented as pandas.ArrowDtype(pyarrow.json_())\n",
- "instead of using `db_dtypes` in the future when available in pandas\n",
- "(https://github.com/pandas-dev/pandas/issues/60958) and pyarrow.\n",
- " warnings.warn(msg, bigframes.exceptions.JSONDtypeWarning)\n",
- "/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/dtypes.py:987: JSONDtypeWarning: JSON columns will be represented as pandas.ArrowDtype(pyarrow.json_())\n",
- "instead of using `db_dtypes` in the future when available in pandas\n",
- "(https://github.com/pandas-dev/pandas/issues/60958) and pyarrow.\n",
- " warnings.warn(msg, bigframes.exceptions.JSONDtypeWarning)\n"
- ]
- },
{
"data": {
"application/vnd.jupyter.widget-view+json": {
- "model_id": "9d60a47296214553bb10c434b5ee8330",
+ "model_id": "b9dd4b812443455ba32ec71723331a10",
"version_major": 2,
"version_minor": 1
},
@@ -858,16 +690,16 @@
" | EU | \n",
" DE | \n",
" 03.10.2018 | \n",
- " H05B 6/12 | \n",
- " <NA> | \n",
- " 18165514.3 | \n",
- " 03.04.2018 | \n",
- " 30.03.2017 | \n",
+ " G06F 11/30 | \n",
" <NA> | \n",
- " BSH Hausger√§te GmbH | \n",
- " Acero Acero, Jesus | \n",
- " VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG | \n",
- " EP 3 383 141 A2 | \n",
+ " 18157347.8 | \n",
+ " 19.02.2018 | \n",
+ " 31.03.2017 | \n",
+ " Hoffmann Eitle | \n",
+ " FUJITSU LIMITED | \n",
+ " Kukihara, Kensuke | \n",
+ " METHOD EXECUTED BY A COMPUTER, INFORMATION PRO... | \n",
+ " EP 3 382 553 A1 | \n",
" \n",
" \n",
" | 2 | \n",
@@ -876,16 +708,16 @@
" EU | \n",
" DE | \n",
" 03.10.2018 | \n",
- " H01L 21/20 | \n",
- " <NA> | \n",
- " 18166536.5 | \n",
- " 16.02.2016 | \n",
+ " A01K 31/00 | \n",
" <NA> | \n",
- " Scheider, Sascha et al | \n",
- " EV Group E. Thallner GmbH | \n",
- " Kurz, Florian | \n",
- " VORRICHTUNG ZUM BONDEN VON SUBSTRATEN | \n",
- " EP 3 382 744 A1 | \n",
+ " 18171005.4 | \n",
+ " 05.02.2015 | \n",
+ " 05.02.2014 | \n",
+ " Stork Bamberger Patentanw√§lte | \n",
+ " Linco Food Systems A/S | \n",
+ " Thrane, Uffe | \n",
+ " MASTHÄHNCHENCONTAINER ALS BESTANDTEIL EINER E... | \n",
+ " EP 3 381 276 A1 | \n",
"
\n",
" \n",
" | 3 | \n",
@@ -894,16 +726,16 @@
" EU | \n",
" DE | \n",
" 03.10.2018 | \n",
- " G06F 11/30 | \n",
+ " H05B 6/12 | \n",
" <NA> | \n",
- " 18157347.8 | \n",
- " 19.02.2018 | \n",
- " 31.03.2017 | \n",
- " Hoffmann Eitle | \n",
- " FUJITSU LIMITED | \n",
- " Kukihara, Kensuke | \n",
- " METHOD EXECUTED BY A COMPUTER, INFORMATION PRO... | \n",
- " EP 3 382 553 A1 | \n",
+ " 18165514.3 | \n",
+ " 03.04.2018 | \n",
+ " 30.03.2017 | \n",
+ " <NA> | \n",
+ " BSH Hausger√§te GmbH | \n",
+ " Acero Acero, Jesus | \n",
+ " VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG | \n",
+ " EP 3 383 141 A2 | \n",
"
\n",
" \n",
" | 4 | \n",
@@ -912,16 +744,16 @@
" EU | \n",
" DE | \n",
" 03.10.2018 | \n",
- " A01K 31/00 | \n",
+ " H01L 21/20 | \n",
" <NA> | \n",
- " 18171005.4 | \n",
- " 05.02.2015 | \n",
- " 05.02.2014 | \n",
- " Stork Bamberger Patentanw√§lte | \n",
- " Linco Food Systems A/S | \n",
- " Thrane, Uffe | \n",
- " MASTHÄHNCHENCONTAINER ALS BESTANDTEIL EINER E... | \n",
- " EP 3 381 276 A1 | \n",
+ " 18166536.5 | \n",
+ " 16.02.2016 | \n",
+ " <NA> | \n",
+ " Scheider, Sascha et al | \n",
+ " EV Group E. Thallner GmbH | \n",
+ " Kurz, Florian | \n",
+ " VORRICHTUNG ZUM BONDEN VON SUBSTRATEN | \n",
+ " EP 3 382 744 A1 | \n",
"
\n",
" \n",
"\n",
@@ -945,31 +777,31 @@
"\n",
" publication_date class_international class_us application_number \\\n",
"0 29.08.018 E04H 6/12 18157874.1 \n",
- "1 03.10.2018 H05B 6/12 18165514.3 \n",
- "2 03.10.2018 H01L 21/20 18166536.5 \n",
- "3 03.10.2018 G06F 11/30 18157347.8 \n",
- "4 03.10.2018 A01K 31/00 18171005.4 \n",
+ "1 03.10.2018 G06F 11/30 18157347.8 \n",
+ "2 03.10.2018 A01K 31/00 18171005.4 \n",
+ "3 03.10.2018 H05B 6/12 18165514.3 \n",
+ "4 03.10.2018 H01L 21/20 18166536.5 \n",
"\n",
" filing_date priority_date_eu representative_line_1_eu \\\n",
"0 21.02.2018 22.02.2017 Liedtke & Partner Patentanw√§lte \n",
- "1 03.04.2018 30.03.2017 \n",
- "2 16.02.2016 Scheider, Sascha et al \n",
- "3 19.02.2018 31.03.2017 Hoffmann Eitle \n",
- "4 05.02.2015 05.02.2014 Stork Bamberger Patentanw√§lte \n",
+ "1 19.02.2018 31.03.2017 Hoffmann Eitle \n",
+ "2 05.02.2015 05.02.2014 Stork Bamberger Patentanw√§lte \n",
+ "3 03.04.2018 30.03.2017 \n",
+ "4 16.02.2016 Scheider, Sascha et al \n",
"\n",
" applicant_line_1 inventor_line_1 \\\n",
"0 SHB Hebezeugbau GmbH VOLGER, Alexander \n",
- "1 BSH Hausger√§te GmbH Acero Acero, Jesus \n",
- "2 EV Group E. Thallner GmbH Kurz, Florian \n",
- "3 FUJITSU LIMITED Kukihara, Kensuke \n",
- "4 Linco Food Systems A/S Thrane, Uffe \n",
+ "1 FUJITSU LIMITED Kukihara, Kensuke \n",
+ "2 Linco Food Systems A/S Thrane, Uffe \n",
+ "3 BSH Hausger√§te GmbH Acero Acero, Jesus \n",
+ "4 EV Group E. Thallner GmbH Kurz, Florian \n",
"\n",
" title_line_1 number \n",
"0 STEUERUNGSSYSTEM FÜR AUTOMATISCHE PARKHÄUSER EP 3 366 869 A1 \n",
- "1 VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG EP 3 383 141 A2 \n",
- "2 VORRICHTUNG ZUM BONDEN VON SUBSTRATEN EP 3 382 744 A1 \n",
- "3 METHOD EXECUTED BY A COMPUTER, INFORMATION PRO... EP 3 382 553 A1 \n",
- "4 MASTHÄHNCHENCONTAINER ALS BESTANDTEIL EINER E... EP 3 381 276 A1 \n",
+ "1 METHOD EXECUTED BY A COMPUTER, INFORMATION PRO... EP 3 382 553 A1 \n",
+ "2 MASTHÄHNCHENCONTAINER ALS BESTANDTEIL EINER E... EP 3 381 276 A1 \n",
+ "3 VORRICHTUNG ZUR INDUKTIVEN ENERGIE√úBERTRAGUNG EP 3 383 141 A2 \n",
+ "4 VORRICHTUNG ZUM BONDEN VON SUBSTRATEN EP 3 382 744 A1 \n",
"\n",
"[5 rows x 15 columns]"
]
@@ -995,7 +827,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "venv",
+ "display_name": "venv (3.13.0)",
"language": "python",
"name": "python3"
},
diff --git a/notebooks/ml/timeseries_analysis.ipynb b/notebooks/ml/timeseries_analysis.ipynb
index 01c5a20efa..84959b3632 100644
--- a/notebooks/ml/timeseries_analysis.ipynb
+++ b/notebooks/ml/timeseries_analysis.ipynb
@@ -12,14 +12,14 @@
},
{
"cell_type": "code",
- "execution_count": 1,
+ "execution_count": null,
"id": "c0b2db75",
"metadata": {},
"outputs": [],
"source": [
"import bigframes.pandas as bpd\n",
"from bigframes.ml import forecasting\n",
- "bpd.options.display.repr_mode = \"anywidget\""
+ "bpd.options.display.render_mode = \"anywidget\""
]
},
{
@@ -1113,7 +1113,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "venv",
+ "display_name": "venv (3.13.0)",
"language": "python",
"name": "python3"
},
diff --git a/tests/system/small/test_anywidget.py b/tests/system/small/test_anywidget.py
index b9f7b87f5e..607d7f0194 100644
--- a/tests/system/small/test_anywidget.py
+++ b/tests/system/small/test_anywidget.py
@@ -70,7 +70,7 @@ def table_widget(paginated_bf_df: bigframes.dataframe.DataFrame):
from bigframes.display import TableWidget
with bigframes.option_context(
- "display.repr_mode", "anywidget", "display.max_rows", 2
+ "display.render_mode", "anywidget", "display.max_rows", 2
):
# Delay context manager cleanup of `max_rows` until after tests finish.
yield TableWidget(paginated_bf_df)
@@ -100,7 +100,7 @@ def small_widget(small_bf_df):
"""Helper fixture for tests using a DataFrame smaller than the page size."""
from bigframes.display import TableWidget
- with bf.option_context("display.repr_mode", "anywidget", "display.max_rows", 5):
+ with bf.option_context("display.render_mode", "anywidget", "display.max_rows", 5):
yield TableWidget(small_bf_df)
@@ -126,7 +126,9 @@ def unknown_row_count_widget(session):
mock_batches.return_value = blocks.PandasBatches(
batches_iterator, total_rows=None
)
- with bf.option_context("display.repr_mode", "anywidget", "display.max_rows", 2):
+ with bf.option_context(
+ "display.render_mode", "anywidget", "display.max_rows", 2
+ ):
widget = TableWidget(bf_df)
yield widget
@@ -206,7 +208,7 @@ def test_widget_initialization_should_calculate_total_row_count(
from bigframes.display import TableWidget
with bigframes.option_context(
- "display.repr_mode", "anywidget", "display.max_rows", 2
+ "display.render_mode", "anywidget", "display.max_rows", 2
):
widget = TableWidget(paginated_bf_df)
@@ -316,7 +318,7 @@ def test_widget_pagination_should_work_with_custom_page_size(
):
"""Test that a widget paginates correctly with a custom page size."""
with bigframes.option_context(
- "display.repr_mode", "anywidget", "display.max_rows", 3
+ "display.render_mode", "anywidget", "display.max_rows", 3
):
from bigframes.display import TableWidget
@@ -370,7 +372,7 @@ def test_global_options_change_should_not_affect_existing_widget_page_size(
then the widget's page size should remain unchanged.
"""
with bigframes.option_context(
- "display.repr_mode", "anywidget", "display.max_rows", 2
+ "display.render_mode", "anywidget", "display.max_rows", 2
):
from bigframes.display import TableWidget
@@ -395,7 +397,7 @@ def test_widget_with_empty_dataframe_should_have_zero_row_count(
then its row_count should be 0.
"""
- with bigframes.option_context("display.repr_mode", "anywidget"):
+ with bigframes.option_context("display.render_mode", "anywidget"):
from bigframes.display import TableWidget
widget = TableWidget(empty_bf_df)
@@ -407,28 +409,17 @@ def test_widget_with_empty_dataframe_should_render_table_headers(
empty_bf_df: bf.dataframe.DataFrame,
):
"""
-
-
Given an empty DataFrame,
-
-
when a widget is created from it,
-
-
then its HTML representation should still render the table headers.
-
-
"""
- with bigframes.option_context("display.repr_mode", "anywidget"):
+ with bigframes.option_context("display.render_mode", "anywidget"):
from bigframes.display import TableWidget
widget = TableWidget(empty_bf_df)
-
html = widget.table_html
-
assert ">> import bigframes.pandas as bpd
>>> bpd.options.display.repr_mode = "deferred" # doctest: +SKIP
"""
+ render_mode: Literal["plaintext", "html", "anywidget"] = "html"
+ """
+ Determines how to visualize a DataFrame or Series. Default "html".
+
+ `plaintext`
+ Display as plain text.
+
+ `html`
+ Display as HTML table.
+
+ `anywidget`
+ Display as interactive widget using `anywidget` library.
+ """
+
max_colwidth: Optional[int] = 50
"""
The maximum width in characters of a column in the repr. Default 50.