Skip to content

Commit d01a4ba

Browse files
authored
feat: create Series.bigquery.function_name accessors for array and AEAD functions (#17279)
🦕
1 parent 1f6205e commit d01a4ba

20 files changed

Lines changed: 1577 additions & 20 deletions

File tree

packages/bigframes/bigframes/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
# Register pandas extensions
4444
import bigframes.extensions.pandas.dataframe_accessor # noqa: F401, E402
45+
import bigframes.extensions.pandas.series_accessor # noqa: F401, E402
4546
from bigframes._config.bigquery_options import BigQueryOptions # noqa: E402
4647
from bigframes.core.global_session import ( # noqa: E402
4748
close_session,

packages/bigframes/bigframes/extensions/bigframes/__init__.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,12 @@
1616
BigframesAIAccessor,
1717
BigframesBigQueryDataFrameAccessor,
1818
)
19+
from bigframes.extensions.bigframes.series_accessor import (
20+
BigframesBigQuerySeriesAccessor,
21+
)
1922

20-
__all__ = ["BigframesAIAccessor", "BigframesBigQueryDataFrameAccessor"]
23+
__all__ = [
24+
"BigframesAIAccessor",
25+
"BigframesBigQueryDataFrameAccessor",
26+
"BigframesBigQuerySeriesAccessor",
27+
]
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Copyright 2026 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+
# DO NOT MODIFY THIS FILE DIRECTLY.
16+
# This file was generated by the script: scripts/generate_bigframes_bigquery.py
17+
#
18+
19+
from __future__ import annotations
20+
21+
from typing import Optional, TypeVar, cast
22+
23+
import bigframes.extensions.core.series_accessor as core_accessor
24+
import bigframes.series
25+
import bigframes.session
26+
from bigframes.core.logging import log_adapter
27+
28+
S = TypeVar("S", bound="bigframes.series.Series")
29+
30+
31+
@log_adapter.class_logger
32+
class BigframesBigQuerySeriesAccessor(core_accessor.BigQuerySeriesAccessor[S]):
33+
def __init__(self, bf_obj: S):
34+
super().__init__(bf_obj)
35+
36+
def _bf_from_series(
37+
self, session: Optional[bigframes.session.Session] = None
38+
) -> bigframes.series.Series:
39+
return self._obj
40+
41+
def _to_series(self, bf_series: bigframes.series.Series) -> S:
42+
return cast(S, bf_series)
43+
44+
@property
45+
def aead(self) -> BigframesAeadSeriesAccessor[S]:
46+
return BigframesAeadSeriesAccessor(self._obj)
47+
48+
49+
@log_adapter.class_logger
50+
class BigframesAeadSeriesAccessor(core_accessor.AeadSeriesAccessor[S]):
51+
def __init__(self, bf_obj: S):
52+
super().__init__(bf_obj)
53+
54+
def _bf_from_series(
55+
self, session: Optional[bigframes.session.Session] = None
56+
) -> bigframes.series.Series:
57+
return self._obj
58+
59+
def _to_series(self, bf_series: bigframes.series.Series) -> S:
60+
return cast(S, bf_series)

0 commit comments

Comments
 (0)