From 57bc9ab7fb9eb33d2aaac504b025b5ef5bcd2771 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Wed, 17 Jan 2024 14:20:47 -0600 Subject: [PATCH 1/2] refactor: move remote_function logic to make a space for other types (#322) --- bigframes/functions/__init__.py | 13 +++++++++++++ bigframes/{ => functions}/remote_function.py | 0 bigframes/session/__init__.py | 4 ++-- tests/system/large/test_remote_function.py | 2 +- tests/system/small/test_remote_function.py | 2 +- tests/unit/test_dtypes.py | 2 +- tests/unit/test_remote_function.py | 2 +- 7 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 bigframes/functions/__init__.py rename bigframes/{ => functions}/remote_function.py (100%) diff --git a/bigframes/functions/__init__.py b/bigframes/functions/__init__.py new file mode 100644 index 0000000000..6d5e14bcf4 --- /dev/null +++ b/bigframes/functions/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/bigframes/remote_function.py b/bigframes/functions/remote_function.py similarity index 100% rename from bigframes/remote_function.py rename to bigframes/functions/remote_function.py diff --git a/bigframes/session/__init__.py b/bigframes/session/__init__.py index d503b844aa..2e630e4fad 100644 --- a/bigframes/session/__init__.py +++ b/bigframes/session/__init__.py @@ -74,8 +74,8 @@ import bigframes.core.utils as utils import bigframes.dataframe as dataframe import bigframes.formatting_helpers as formatting_helpers -from bigframes.remote_function import read_gbq_function as bigframes_rgf -from bigframes.remote_function import remote_function as bigframes_rf +from bigframes.functions.remote_function import read_gbq_function as bigframes_rgf +from bigframes.functions.remote_function import remote_function as bigframes_rf import bigframes.session._io.bigquery as bigframes_io import bigframes.session.clients import bigframes.version diff --git a/tests/system/large/test_remote_function.py b/tests/system/large/test_remote_function.py index 4b4c794a05..773de48adf 100644 --- a/tests/system/large/test_remote_function.py +++ b/tests/system/large/test_remote_function.py @@ -28,7 +28,7 @@ import test_utils.prefixer import bigframes -from bigframes.remote_function import ( +from bigframes.functions.remote_function import ( get_cloud_function_name, get_remote_function_locations, ) diff --git a/tests/system/small/test_remote_function.py b/tests/system/small/test_remote_function.py index a98056d82a..1cf494ea6b 100644 --- a/tests/system/small/test_remote_function.py +++ b/tests/system/small/test_remote_function.py @@ -17,7 +17,7 @@ import pytest import bigframes -from bigframes import remote_function as rf +from bigframes.functions import remote_function as rf from tests.system.utils import assert_pandas_df_equal diff --git a/tests/unit/test_dtypes.py b/tests/unit/test_dtypes.py index e648fd28cc..047ad5638d 100644 --- a/tests/unit/test_dtypes.py +++ b/tests/unit/test_dtypes.py @@ -241,7 +241,7 @@ def test_literal_to_ibis_scalar_throws_on_incompatible_literal(): def test_remote_function_io_types_are_supported_bigframes_types(): from ibis.expr.datatypes.core import dtype as python_type_to_bigquery_type - from bigframes.remote_function import ( + from bigframes.functions.remote_function import ( SUPPORTED_IO_PYTHON_TYPES as rf_supported_io_types, ) diff --git a/tests/unit/test_remote_function.py b/tests/unit/test_remote_function.py index 540f4020d3..ed24ada6c7 100644 --- a/tests/unit/test_remote_function.py +++ b/tests/unit/test_remote_function.py @@ -15,7 +15,7 @@ from ibis.backends.bigquery import datatypes as bq_types from ibis.expr import datatypes as ibis_types -from bigframes import remote_function as rf +from bigframes.functions import remote_function as rf def test_supported_types_correspond(): From f45c078f5086a7098fb0ba3fbd1447ccf637a3e1 Mon Sep 17 00:00:00 2001 From: Huan Chen <142538604+Genesis929@users.noreply.github.com> Date: Wed, 17 Jan 2024 16:43:55 -0800 Subject: [PATCH 2/2] chore: add ml_fundamentals_bq_dataframes.ipynb to denylist. (#325) --- noxfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile.py b/noxfile.py index f25cb9fa10..62fbee2650 100644 --- a/noxfile.py +++ b/noxfile.py @@ -664,6 +664,7 @@ def notebook(session): # appropriate values and omitting cleanup logic that may break # our test infrastructure. "notebooks/getting_started/getting_started_bq_dataframes.ipynb", + "notebooks/getting_started/ml_fundamentals_bq_dataframes.ipynb", "notebooks/generative_ai/bq_dataframes_llm_code_generation.ipynb", "notebooks/generative_ai/bq_dataframes_llm_kmeans.ipynb", "notebooks/regression/bq_dataframes_ml_linear_regression.ipynb",