Skip to content

Commit 3e7bba7

Browse files
committed
docs: add missing classes
1 parent 26db5d1 commit 3e7bba7

File tree

5 files changed

+102
-18
lines changed

5 files changed

+102
-18
lines changed

bigframes/pandas/__init__.py

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@
2828

2929
import bigframes._config as config
3030
from bigframes.core import log_adapter
31-
import bigframes.core.blocks
3231
import bigframes.core.global_session as global_session
3332
import bigframes.core.indexes
3433
from bigframes.core.reshape.api import concat, crosstab, cut, get_dummies, merge, qcut
35-
import bigframes.core.tools
3634
import bigframes.dataframe
37-
import bigframes.enums
3835
import bigframes.functions._utils as bff_utils
36+
from bigframes.pandas import api
3937
from bigframes.pandas.core.api import to_timedelta
4038
from bigframes.pandas.io.api import (
4139
_read_gbq_colab,
@@ -56,7 +54,6 @@
5654
import bigframes.series
5755
import bigframes.session
5856
import bigframes.session._io.bigquery
59-
import bigframes.session.clients
6057
import bigframes.version
6158

6259
try:
@@ -410,8 +407,40 @@ def reset_session():
410407
from_glob_path,
411408
]
412409

413-
_function_names = [_function.__name__ for _function in _functions]
414-
_other_names = [
410+
# Use __all__ to let type checkers know what is part of the public API.
411+
# Note that static analysis checkers like pylance depend on these being string
412+
# literals, not derived at runtime.
413+
__all__ = [
414+
# Function names
415+
"clean_up_by_session_id",
416+
"concat",
417+
"crosstab",
418+
"cut",
419+
"deploy_remote_function",
420+
"deploy_udf",
421+
"get_default_session_id",
422+
"get_dummies",
423+
"merge",
424+
"qcut",
425+
"read_csv",
426+
"read_arrow",
427+
"read_gbq",
428+
"_read_gbq_colab",
429+
"read_gbq_function",
430+
"read_gbq_model",
431+
"read_gbq_object_table",
432+
"read_gbq_query",
433+
"read_gbq_table",
434+
"read_json",
435+
"read_pandas",
436+
"read_parquet",
437+
"read_pickle",
438+
"remote_function",
439+
"to_datetime",
440+
"to_timedelta",
441+
"from_glob_path",
442+
# Other names
443+
"api",
415444
# pandas dtype attributes
416445
"NA",
417446
"BooleanDtype",
@@ -437,9 +466,6 @@ def reset_session():
437466
"udf",
438467
]
439468

440-
# Use __all__ to let type checkers know what is part of the public API.
441-
__all__ = _function_names + _other_names
442-
443469
_module = sys.modules[__name__]
444470

445471
for _function in _functions:

bigframes/pandas/api/__init__.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""BigQuery DataFrames public pandas APIs."""
16+
17+
from bigframes.pandas.api import typing
18+
19+
__all__ = [
20+
"typing",
21+
]

bigframes/pandas/api/typing.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
"""BigQuery DataFrames public pandas types that aren't exposed in bigframes.pandas.
16+
17+
Note: These objects aren't intended to be constructed directly.
18+
"""
19+
20+
from bigframes.core.groupby.dataframe_group_by import DataFrameGroupBy
21+
from bigframes.core.groupby.series_group_by import SeriesGroupBy
22+
from bigframes.core.window import Window
23+
from bigframes.operations.datetimes import DatetimeMethods
24+
from bigframes.operations.strings import StringMethods
25+
from bigframes.operations.structs import StructAccessor, StructFrameAccessor
26+
27+
__all__ = [
28+
"DataFrameGroupBy",
29+
"DatetimeMethods",
30+
"SeriesGroupBy",
31+
"StringMethods",
32+
"StructAccessor",
33+
"StructFrameAccessor",
34+
"Window",
35+
]

docs/reference/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ packages.
1515
bigframes.exceptions
1616
bigframes.geopandas
1717
bigframes.pandas
18+
bigframes.pandas.api.typing
1819
bigframes.streaming
1920

2021
ML APIs

scripts/publish_api_coverage.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@
3838
BIGFRAMES_OBJECT = {
3939
"pandas": "bigframes.pandas",
4040
"dataframe": "bigframes.pandas.DataFrame",
41-
"dataframegroupby": "bigframes.core.groupby.DataFrameGroupBy",
42-
"index": "bigframes.core.indexes.base.Index",
41+
"dataframegroupby": "bigframes.pandas.api.typing.DataFrameGroupBy",
42+
"index": "bigframes.pandas.Index",
4343
"series": "bigframes.pandas.Series",
44-
"seriesgroupby": "bigframes.core.groupby.SeriesGroupBy",
45-
"datetimemethods": "bigframes.operations.datetimes.DatetimeMethods",
46-
"stringmethods": "bigframes.operations.strings.StringMethods",
47-
"window": "bigframes.core.window.Window",
44+
"seriesgroupby": "bigframes.pandas.api.typing.SeriesGroupBy",
45+
"datetimemethods": "bigframes.pandas.api.typing.DatetimeMethods",
46+
"stringmethods": "bigframes.pandas.api.typing.StringMethods",
47+
"window": "bigframes.pandas.api.typing.Window",
4848
}
4949

5050

@@ -288,8 +288,9 @@ def build_api_coverage_table(bigframes_version: str, release_version: str):
288288

289289

290290
def format_api(api_names, is_in_bigframes, api_prefix):
291-
api_name = api_names.str.slice(start=len(f"{api_prefix}."))
292-
formatted = "<code>" + api_name + "</code>"
291+
api_names = api_names.str.slice(start=len(f"{api_prefix}."))
292+
api_names = api_names[~(api_names.str.startswith("_"))]
293+
formatted = "<code>" + api_names + "</code>"
293294
bigframes_object = BIGFRAMES_OBJECT.get(api_prefix)
294295
if bigframes_object is None:
295296
return formatted
@@ -298,7 +299,7 @@ def format_api(api_names, is_in_bigframes, api_prefix):
298299
'<a href="https://dataframes.bigquery.dev/reference/api/'
299300
+ bigframes_object
300301
+ "."
301-
+ api_name
302+
+ api_names
302303
+ '.html">'
303304
+ formatted
304305
+ "</a>"

0 commit comments

Comments
 (0)