Skip to content

Commit c7e4a27

Browse files
Update supported pandas APIs documentation links
Updated the `scripts/publish_api_coverage.py` script to generate documentation links that point to the new structure on `dataframes.bigquery.dev`. Instead of a monolithic page with anchors, the links now point to individual sub-pages for each API method/attribute, following the format `https://dataframes.bigquery.dev/reference/api/<FullClassName>.<MemberName>.html`. Updated the `URL_PREFIX` mapping to use fully qualified Python class names.
1 parent f271962 commit c7e4a27

File tree

1 file changed

+20
-30
lines changed

1 file changed

+20
-30
lines changed

scripts/publish_api_coverage.py

Lines changed: 20 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -36,33 +36,15 @@
3636
REPO_ROOT = pathlib.Path(__file__).parent.parent
3737

3838
URL_PREFIX = {
39-
"pandas": (
40-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.pandas#bigframes_pandas_"
41-
),
42-
"dataframe": (
43-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.dataframe.DataFrame#bigframes_dataframe_DataFrame_"
44-
),
45-
"dataframegroupby": (
46-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.core.groupby.DataFrameGroupBy#bigframes_core_groupby_DataFrameGroupBy_"
47-
),
48-
"index": (
49-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.core.indexes.base.Index#bigframes_core_indexes_base_Index_"
50-
),
51-
"series": (
52-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.series.Series#bigframes_series_Series_"
53-
),
54-
"seriesgroupby": (
55-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.core.groupby.SeriesGroupBy#bigframes_core_groupby_SeriesGroupBy_"
56-
),
57-
"datetimemethods": (
58-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.operations.datetimes.DatetimeMethods#bigframes_operations_datetimes_DatetimeMethods_"
59-
),
60-
"stringmethods": (
61-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.operations.strings.StringMethods#bigframes_operations_strings_StringMethods_"
62-
),
63-
"window": (
64-
"https://cloud.google.com/python/docs/reference/bigframes/latest/bigframes.core.window.Window#bigframes_core_window_Window_"
65-
),
39+
"pandas": "bigframes.pandas",
40+
"dataframe": "bigframes.pandas.DataFrame",
41+
"dataframegroupby": "bigframes.core.groupby.DataFrameGroupBy",
42+
"index": "bigframes.core.indexes.base.Index",
43+
"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",
6648
}
6749

6850

@@ -308,11 +290,19 @@ def build_api_coverage_table(bigframes_version: str, release_version: str):
308290
def format_api(api_names, is_in_bigframes, api_prefix):
309291
api_names = api_names.str.slice(start=len(f"{api_prefix}."))
310292
formatted = "<code>" + api_names + "</code>"
311-
url_prefix = URL_PREFIX.get(api_prefix)
312-
if url_prefix is None:
293+
url_base = URL_PREFIX.get(api_prefix)
294+
if url_base is None:
313295
return formatted
314296

315-
linked = '<a href="' + url_prefix + api_names + '">' + formatted + "</a>"
297+
linked = (
298+
'<a href="https://dataframes.bigquery.dev/reference/api/'
299+
+ url_base
300+
+ "."
301+
+ api_names
302+
+ '.html">'
303+
+ formatted
304+
+ "</a>"
305+
)
316306
return formatted.mask(is_in_bigframes, linked)
317307

318308

0 commit comments

Comments
 (0)