Skip to content

Commit 6785aee

Browse files
authored
fix: remove warnings for null index and partial ordering mode in prep for GA (#1431)
1 parent 0adf548 commit 6785aee

File tree

5 files changed

+10
-46
lines changed

5 files changed

+10
-46
lines changed

bigframes/core/blocks.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
import bigframes.core.utils as utils
6565
import bigframes.core.window_spec as windows
6666
import bigframes.dtypes
67-
import bigframes.exceptions as bfe
6867
import bigframes.features
6968
import bigframes.operations as ops
7069
import bigframes.operations.aggregations as agg_ops
@@ -137,9 +136,6 @@ def __init__(
137136
f"'index_columns' (size {len(index_columns)}) and 'index_labels' (size {len(index_labels)}) must have equal length"
138137
)
139138

140-
if len(index_columns) == 0:
141-
msg = "Creating object with Null Index. Null Index is a preview feature."
142-
warnings.warn(msg, category=bfe.NullIndexPreviewWarning)
143139
self._index_columns = tuple(index_columns)
144140
# Index labels don't need complicated hierarchical access so can store as tuple
145141
self._index_labels = (

bigframes/exceptions.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,21 @@ class PreviewWarning(Warning):
4040

4141

4242
class NullIndexPreviewWarning(PreviewWarning):
43-
"""Null index feature is in preview."""
43+
"""Unused. Kept for backwards compatibility.
44+
45+
Was used when null index feature was in preview.
46+
"""
4447

4548

4649
class NullIndexError(ValueError):
4750
"""Object has no index."""
4851

4952

5053
class OrderingModePartialPreviewWarning(PreviewWarning):
51-
"""Ordering mode 'partial' is in preview."""
54+
"""Unused. Kept for backwards compatibility.
55+
56+
Was used when ordering mode 'partial' was in preview.
57+
"""
5258

5359

5460
class OrderRequiredError(ValueError):

bigframes/session/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,6 @@ def __init__(
234234
# Whether this session treats objects as totally ordered.
235235
# Will expose as feature later, only False for internal testing
236236
self._strictly_ordered: bool = context.ordering_mode != "partial"
237-
if not self._strictly_ordered:
238-
msg = "Partial ordering mode is a preview feature and is subject to change."
239-
warnings.warn(msg, bfe.OrderingModePartialPreviewWarning)
240-
241237
self._allow_ambiguity = not self._strictly_ordered
242238
self._default_index_type = (
243239
bigframes.enums.DefaultIndexKind.SEQUENTIAL_INT64

notebooks/dataframes/index_col_null.ipynb

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,15 @@
3838
},
3939
{
4040
"cell_type": "code",
41-
"execution_count": 2,
41+
"execution_count": null,
4242
"id": "96757c59-fc22-420e-a42f-c6cb956110ec",
4343
"metadata": {},
4444
"outputs": [],
4545
"source": [
46-
"import warnings\n",
47-
"\n",
4846
"import bigframes.enums\n",
4947
"import bigframes.exceptions\n",
5048
"import bigframes.pandas as bpd\n",
5149
"\n",
52-
"# Explicitly opt-in to the NULL index preview feature.\n",
53-
"warnings.simplefilter(\n",
54-
" \"ignore\",\n",
55-
" bigframes.exceptions.NullIndexPreviewWarning,\n",
56-
")\n",
57-
"\n",
5850
"df = bpd.read_gbq(\n",
5951
" \"bigquery-public-data.baseball.schedules\",\n",
6052
" index_col=bigframes.enums.DefaultIndexKind.NULL,\n",

notebooks/dataframes/pypi.ipynb

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@
2727
"source": [
2828
"# Analyzing package downloads from PyPI with BigQuery DataFrames\n",
2929
"\n",
30-
"In this notebook, you'll use the [PyPI public dataset](https://console.cloud.google.com/marketplace/product/gcp-public-data-pypi/pypi) and the [deps.dev public dataset](https://deps.dev/) to visualize Python package downloads for a package and its dependencies.\n",
31-
"\n",
32-
"> **⚠ Important**\n",
33-
">\n",
34-
"> You'll use features that are currently in [preview](https://cloud.google.com/blog/products/gcp/google-cloud-gets-simplified-product-launch-stages): `ordering_mode=\"partial\"` and \"NULL\" indexes. There may be breaking changes to this functionality in future versions of the BigQuery DataFrames package.\n",
35-
"\n"
30+
"In this notebook, you'll use the [PyPI public dataset](https://console.cloud.google.com/marketplace/product/gcp-public-data-pypi/pypi) and the [deps.dev public dataset](https://deps.dev/) to visualize Python package downloads for a package and its dependencies."
3631
]
3732
},
3833
{
@@ -59,27 +54,6 @@
5954
"bpd.options.bigquery.ordering_mode = \"partial\""
6055
]
6156
},
62-
{
63-
"cell_type": "markdown",
64-
"metadata": {},
65-
"source": [
66-
"Filter out the relevant warnings for preview features used."
67-
]
68-
},
69-
{
70-
"cell_type": "code",
71-
"execution_count": 4,
72-
"metadata": {},
73-
"outputs": [],
74-
"source": [
75-
"import warnings\n",
76-
"\n",
77-
"import bigframes.exceptions\n",
78-
"\n",
79-
"warnings.simplefilter(\"ignore\", category=bigframes.exceptions.NullIndexPreviewWarning)\n",
80-
"warnings.simplefilter(\"ignore\", category=bigframes.exceptions.OrderingModePartialPreviewWarning)"
81-
]
82-
},
8357
{
8458
"cell_type": "markdown",
8559
"metadata": {},

0 commit comments

Comments
 (0)