|
| 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