Skip to content

Commit 5ba9eb3

Browse files
committed
finish refactoring
1 parent 310a93a commit 5ba9eb3

22 files changed

Lines changed: 179 additions & 76 deletions

File tree

packages/bigframes/bigframes/extensions/bigframes/series_accessor.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
16-
# This file was generated by the script: scripts/generate_bigframes_bigquery.py
16+
# This file was generated by the script: scripts
1717
#
1818

1919
from __future__ import annotations
@@ -44,17 +44,17 @@ def _to_dataframe(self, bf_df: dataframe.DataFrame) -> T:
4444
def _to_series(self, bf_series: series.Series) -> S:
4545
return cast(S, bf_series)
4646

47-
@property
48-
def ai(self) -> BigframesAiSeriesAccessor[T, S]:
49-
return BigframesAiSeriesAccessor(self._obj)
50-
5147
@property
5248
def aead(self) -> BigframesAeadSeriesAccessor[T, S]:
5349
return BigframesAeadSeriesAccessor(self._obj)
5450

51+
@property
52+
def ai(self) -> BigframesAiSeriesAccessor[T, S]:
53+
return BigframesAiSeriesAccessor(self._obj)
54+
5555

5656
@log_adapter.class_logger
57-
class BigframesAiSeriesAccessor(core_accessor.AiSeriesAccessor[T, S]):
57+
class BigframesAeadSeriesAccessor(core_accessor.AeadSeriesAccessor[T, S]):
5858
def __init__(self, bf_obj: S):
5959
super().__init__(bf_obj)
6060

@@ -71,7 +71,7 @@ def _to_series(self, bf_series: series.Series) -> S:
7171

7272

7373
@log_adapter.class_logger
74-
class BigframesAeadSeriesAccessor(core_accessor.AeadSeriesAccessor[T, S]):
74+
class BigframesAiSeriesAccessor(core_accessor.AiSeriesAccessor[T, S]):
7575
def __init__(self, bf_obj: S):
7676
super().__init__(bf_obj)
7777

packages/bigframes/bigframes/extensions/core/series_accessor.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
16-
# This file was generated by the script: scripts/generate_bigframes_bigquery.py
16+
# This file was generated by the script: scripts
1717
#
1818

1919
from __future__ import annotations
@@ -44,13 +44,13 @@ class BigQuerySeriesAccessor(
4444

4545
@property
4646
@abc.abstractmethod
47-
def ai(self) -> AiSeriesAccessor[T, S]:
48-
"""Accessor for BigQuery ai functions."""
47+
def aead(self) -> AeadSeriesAccessor[T, S]:
48+
"""Accessor for BigQuery aead functions."""
4949

5050
@property
5151
@abc.abstractmethod
52-
def aead(self) -> AeadSeriesAccessor[T, S]:
53-
"""Accessor for BigQuery aead functions."""
52+
def ai(self) -> AiSeriesAccessor[T, S]:
53+
"""Accessor for BigQuery ai functions."""
5454

5555
def deterministic_decrypt_bytes(
5656
self,
@@ -1112,10 +1112,6 @@ def unix_date(
11121112
return self._to_series(cast(series.Series, result))
11131113

11141114

1115-
class AiSeriesAccessor(series_tvf_mixins.AITVFMixin[T, S]):
1116-
"""Series accessor for BigQuery ai functions."""
1117-
1118-
11191115
class AeadSeriesAccessor(abstract_series_accessor.AbstractBigQuerySeriesAccessor[T, S]):
11201116
"""Series accessor for BigQuery aead functions."""
11211117

@@ -1227,3 +1223,7 @@ def encrypt(
12271223
additional_data,
12281224
)
12291225
return self._to_series(cast(series.Series, result))
1226+
1227+
1228+
class AiSeriesAccessor(series_tvf_mixins.AITVFMixin[T, S]):
1229+
"""Series accessor for BigQuery ai functions."""

packages/bigframes/bigframes/extensions/pandas/series_accessor.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
16-
# This file was generated by the script: scripts/generate_bigframes_bigquery.py
16+
# This file was generated by the script: scripts
1717
#
1818

1919
from __future__ import annotations
@@ -51,17 +51,17 @@ def _to_dataframe(self, bf_df: dataframe.DataFrame) -> T:
5151
def _to_series(self, bf_series: series.Series) -> S:
5252
return cast(S, bf_series.to_pandas(ordered=True))
5353

54-
@property
55-
def ai(self) -> PandasAiSeriesAccessor[T, S]:
56-
return PandasAiSeriesAccessor(self._obj)
57-
5854
@property
5955
def aead(self) -> PandasAeadSeriesAccessor[T, S]:
6056
return PandasAeadSeriesAccessor(self._obj)
6157

58+
@property
59+
def ai(self) -> PandasAiSeriesAccessor[T, S]:
60+
return PandasAiSeriesAccessor(self._obj)
61+
6262

6363
@log_adapter.class_logger
64-
class PandasAiSeriesAccessor(core_accessor.AiSeriesAccessor[T, S]):
64+
class PandasAeadSeriesAccessor(core_accessor.AeadSeriesAccessor[T, S]):
6565
def __init__(self, pandas_obj: S):
6666
super().__init__(pandas_obj)
6767

@@ -80,7 +80,7 @@ def _to_series(self, bf_series: series.Series) -> S:
8080

8181

8282
@log_adapter.class_logger
83-
class PandasAeadSeriesAccessor(core_accessor.AeadSeriesAccessor[T, S]):
83+
class PandasAiSeriesAccessor(core_accessor.AiSeriesAccessor[T, S]):
8484
def __init__(self, pandas_obj: S):
8585
super().__init__(pandas_obj)
8686

packages/bigframes/bigframes/operations/googlesql/aead.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
1616
# This file was generated from: scripts/data/sql-functions/aead.yaml
17-
# by the script: scripts/generate_bigframes_bigquery.py
17+
# by the script: scripts
1818

1919
from __future__ import annotations
2020

packages/bigframes/bigframes/operations/googlesql/global_namespace/aead_encryption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
1616
# This file was generated from: scripts/data/sql-functions/global_namespace/aead_encryption.yaml
17-
# by the script: scripts/generate_bigframes_bigquery.py
17+
# by the script: scripts
1818

1919
from __future__ import annotations
2020

packages/bigframes/bigframes/operations/googlesql/global_namespace/array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
1616
# This file was generated from: scripts/data/sql-functions/global_namespace/array.yaml
17-
# by the script: scripts/generate_bigframes_bigquery.py
17+
# by the script: scripts
1818

1919
from __future__ import annotations
2020

packages/bigframes/bigframes/operations/googlesql/global_namespace/bit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
1616
# This file was generated from: scripts/data/sql-functions/global_namespace/bit.yaml
17-
# by the script: scripts/generate_bigframes_bigquery.py
17+
# by the script: scripts
1818

1919
from __future__ import annotations
2020

packages/bigframes/bigframes/operations/googlesql/global_namespace/conversion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
1616
# This file was generated from: scripts/data/sql-functions/global_namespace/conversion.yaml
17-
# by the script: scripts/generate_bigframes_bigquery.py
17+
# by the script: scripts
1818

1919
from __future__ import annotations
2020

packages/bigframes/bigframes/operations/googlesql/global_namespace/date.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#
1515
# DO NOT MODIFY THIS FILE DIRECTLY.
1616
# This file was generated from: scripts/data/sql-functions/global_namespace/date.yaml
17-
# by the script: scripts/generate_bigframes_bigquery.py
17+
# by the script: scripts
1818

1919
from __future__ import annotations
2020

packages/bigframes/scripts/generate_bigframes_bigquery/__init__.py renamed to packages/bigframes/scripts/bigquery_generator/__init__.py

File renamed without changes.

0 commit comments

Comments
 (0)