diff --git a/tests/unit/core/compile/sqlglot/compiler_session.py b/bigframes/testing/compiler_session.py similarity index 100% rename from tests/unit/core/compile/sqlglot/compiler_session.py rename to bigframes/testing/compiler_session.py diff --git a/tests/system/small/engines/engine_utils.py b/bigframes/testing/engine_utils.py similarity index 100% rename from tests/system/small/engines/engine_utils.py rename to bigframes/testing/engine_utils.py diff --git a/tests/system/utils.py b/bigframes/testing/utils.py similarity index 100% rename from tests/system/utils.py rename to bigframes/testing/utils.py diff --git a/pytest.ini b/pytest.ini index 204c743bbf..75b69ce435 100644 --- a/pytest.ini +++ b/pytest.ini @@ -2,3 +2,4 @@ doctest_optionflags = NORMALIZE_WHITESPACE filterwarnings = ignore::pandas.errors.SettingWithCopyWarning +addopts = "--import-mode=importlib" diff --git a/scripts/__init__.py b/scripts/__init__.py deleted file mode 100644 index 6d5e14bcf4..0000000000 --- a/scripts/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# 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/scripts/conftest.py b/scripts/conftest.py new file mode 100644 index 0000000000..83fd2b19af --- /dev/null +++ b/scripts/conftest.py @@ -0,0 +1,8 @@ +from pathlib import Path +import sys + +# inserts scripts into path so that tests can import +project_root = Path(__file__).parent.parent +scripts_dir = project_root / "scripts" + +sys.path.insert(0, str(scripts_dir)) diff --git a/scripts/test_publish_api_coverage.py b/scripts/test_publish_api_coverage.py index 6dea10b608..6e366b6854 100644 --- a/scripts/test_publish_api_coverage.py +++ b/scripts/test_publish_api_coverage.py @@ -15,16 +15,15 @@ import sys import pandas +from publish_api_coverage import build_api_coverage_table import pytest -from . import publish_api_coverage - pytest.importorskip("sklearn") @pytest.fixture def api_coverage_df(): - return publish_api_coverage.build_api_coverage_table("my_bf_ver", "my_release_ver") + return build_api_coverage_table("my_bf_ver", "my_release_ver") @pytest.mark.skipif( diff --git a/tests/system/conftest.py b/tests/system/conftest.py index a4bab1bcfe..4605d9ddbc 100644 --- a/tests/system/conftest.py +++ b/tests/system/conftest.py @@ -41,7 +41,7 @@ import bigframes.dataframe import bigframes.pandas as bpd import bigframes.series -import tests.system.utils +import bigframes.testing.utils # Use this to control the number of cloud functions being deleted in a single # test session. This should help soften the spike of the number of mutations per @@ -615,7 +615,7 @@ def scalars_pandas_df_default_index() -> pd.DataFrame: DATA_DIR / "scalars.jsonl", lines=True, ) - tests.system.utils.convert_pandas_dtypes(df, bytes_col=True) + bigframes.testing.utils.convert_pandas_dtypes(df, bytes_col=True) df = df.set_index("rowindex", drop=False) df.index.name = None @@ -1422,12 +1422,12 @@ def use_fast_query_path(): @pytest.fixture(scope="session", autouse=True) def cleanup_cloud_functions(session, cloudfunctions_client, dataset_id_permanent): """Clean up stale cloud functions.""" - permanent_endpoints = tests.system.utils.get_remote_function_endpoints( + permanent_endpoints = bigframes.testing.utils.get_remote_function_endpoints( session.bqclient, dataset_id_permanent ) delete_count = 0 try: - for cloud_function in tests.system.utils.get_cloud_functions( + for cloud_function in bigframes.testing.utils.get_cloud_functions( cloudfunctions_client, session.bqclient.project, session.bqclient.location, @@ -1447,7 +1447,7 @@ def cleanup_cloud_functions(session, cloudfunctions_client, dataset_id_permanent # Go ahead and delete try: - tests.system.utils.delete_cloud_function( + bigframes.testing.utils.delete_cloud_function( cloudfunctions_client, cloud_function.name ) delete_count += 1 diff --git a/tests/system/large/functions/test_managed_function.py b/tests/system/large/functions/test_managed_function.py index 9eba1907e6..5cb54a00c1 100644 --- a/tests/system/large/functions/test_managed_function.py +++ b/tests/system/large/functions/test_managed_function.py @@ -21,7 +21,7 @@ import bigframes import bigframes.exceptions as bfe import bigframes.pandas as bpd -from tests.system.utils import cleanup_function_assets +from bigframes.testing.utils import cleanup_function_assets prefixer = test_utils.prefixer.Prefixer("bigframes", "") diff --git a/tests/system/large/functions/test_remote_function.py b/tests/system/large/functions/test_remote_function.py index 426813b0ff..9e0dcfe4d7 100644 --- a/tests/system/large/functions/test_remote_function.py +++ b/tests/system/large/functions/test_remote_function.py @@ -36,7 +36,7 @@ import bigframes.functions._utils as bff_utils import bigframes.pandas as bpd import bigframes.series -from tests.system.utils import ( +from bigframes.testing.utils import ( assert_pandas_df_equal, cleanup_function_assets, delete_cloud_function, diff --git a/tests/system/large/ml/test_cluster.py b/tests/system/large/ml/test_cluster.py index 39368f490b..9736199b17 100644 --- a/tests/system/large/ml/test_cluster.py +++ b/tests/system/large/ml/test_cluster.py @@ -15,7 +15,7 @@ import pandas as pd from bigframes.ml import cluster -from tests.system import utils +from bigframes.testing import utils def test_cluster_configure_fit_score_predict( diff --git a/tests/system/large/ml/test_compose.py b/tests/system/large/ml/test_compose.py index cbc702018a..9279324b3c 100644 --- a/tests/system/large/ml/test_compose.py +++ b/tests/system/large/ml/test_compose.py @@ -13,7 +13,7 @@ # limitations under the License. from bigframes.ml import compose, preprocessing -from tests.system import utils +from bigframes.testing import utils def test_columntransformer_standalone_fit_and_transform( diff --git a/tests/system/large/ml/test_core.py b/tests/system/large/ml/test_core.py index c1e1cc19d9..6f0551b1ef 100644 --- a/tests/system/large/ml/test_core.py +++ b/tests/system/large/ml/test_core.py @@ -13,7 +13,7 @@ # limitations under the License. from bigframes.ml import globals -from tests.system import utils +from bigframes.testing import utils def test_bqml_e2e(session, dataset_id, penguins_df_default_index, new_penguins_df): diff --git a/tests/system/large/ml/test_decomposition.py b/tests/system/large/ml/test_decomposition.py index e0e4b79c6f..c36e873816 100644 --- a/tests/system/large/ml/test_decomposition.py +++ b/tests/system/large/ml/test_decomposition.py @@ -16,7 +16,7 @@ import pandas.testing from bigframes.ml import decomposition -from tests.system import utils +from bigframes.testing import utils def test_decomposition_configure_fit_score_predict( diff --git a/tests/system/large/ml/test_ensemble.py b/tests/system/large/ml/test_ensemble.py index 706cbfdfaf..c2e9036eed 100644 --- a/tests/system/large/ml/test_ensemble.py +++ b/tests/system/large/ml/test_ensemble.py @@ -15,7 +15,7 @@ import pytest import bigframes.ml.ensemble -from tests.system import utils +from bigframes.testing import utils @pytest.mark.flaky(retries=2) diff --git a/tests/system/large/ml/test_forecasting.py b/tests/system/large/ml/test_forecasting.py index 56b93e5338..72a0ee469b 100644 --- a/tests/system/large/ml/test_forecasting.py +++ b/tests/system/large/ml/test_forecasting.py @@ -15,7 +15,7 @@ import pytest from bigframes.ml import forecasting -from tests.system import utils +from bigframes.testing import utils ARIMA_EVALUATE_OUTPUT_COL = [ "non_seasonal_p", diff --git a/tests/system/large/ml/test_linear_model.py b/tests/system/large/ml/test_linear_model.py index be98902007..f0e2892ba8 100644 --- a/tests/system/large/ml/test_linear_model.py +++ b/tests/system/large/ml/test_linear_model.py @@ -16,7 +16,7 @@ from bigframes.ml import model_selection import bigframes.ml.linear_model -from tests.system import utils +from bigframes.testing import utils def test_linear_regression_configure_fit_score(penguins_df_default_index, dataset_id): diff --git a/tests/system/large/ml/test_model_selection.py b/tests/system/large/ml/test_model_selection.py index c1856a1537..26174b7ee9 100644 --- a/tests/system/large/ml/test_model_selection.py +++ b/tests/system/large/ml/test_model_selection.py @@ -15,7 +15,7 @@ import pytest from bigframes.ml import linear_model, model_selection -from tests.system import utils +from bigframes.testing import utils @pytest.mark.parametrize( diff --git a/tests/system/large/ml/test_pipeline.py b/tests/system/large/ml/test_pipeline.py index 84a6b11ff2..6c51a11a11 100644 --- a/tests/system/large/ml/test_pipeline.py +++ b/tests/system/large/ml/test_pipeline.py @@ -25,7 +25,7 @@ pipeline, preprocessing, ) -from tests.system import utils +from bigframes.testing import utils def test_pipeline_linear_regression_fit_score_predict( diff --git a/tests/system/load/test_llm.py b/tests/system/load/test_llm.py index 5cf9621ef9..fc04956749 100644 --- a/tests/system/load/test_llm.py +++ b/tests/system/load/test_llm.py @@ -16,7 +16,7 @@ import pytest from bigframes.ml import llm -from tests.system import utils +from bigframes.testing import utils @pytest.fixture(scope="session") diff --git a/tests/system/small/bigquery/test_vector_search.py b/tests/system/small/bigquery/test_vector_search.py index 6297d729ea..a282135fa6 100644 --- a/tests/system/small/bigquery/test_vector_search.py +++ b/tests/system/small/bigquery/test_vector_search.py @@ -23,7 +23,7 @@ import bigframes.bigquery as bbq import bigframes.pandas as bpd -from tests.system.utils import assert_pandas_df_equal +from bigframes.testing.utils import assert_pandas_df_equal # Need at least 5,000 rows to create a vector index. VECTOR_DF = pd.DataFrame( diff --git a/tests/system/small/engines/test_read_local.py b/tests/system/small/engines/test_read_local.py index 0517f45f1a..82af7c984d 100644 --- a/tests/system/small/engines/test_read_local.py +++ b/tests/system/small/engines/test_read_local.py @@ -17,7 +17,7 @@ import bigframes from bigframes.core import identifiers, local_data, nodes from bigframes.session import polars_executor -from tests.system.small.engines.engine_utils import assert_equivalence_execution +from bigframes.testing.engine_utils import assert_equivalence_execution pytest.importorskip("polars") diff --git a/tests/system/small/engines/test_selection.py b/tests/system/small/engines/test_selection.py index 6350e79403..94c8a6463c 100644 --- a/tests/system/small/engines/test_selection.py +++ b/tests/system/small/engines/test_selection.py @@ -16,7 +16,7 @@ from bigframes.core import array_value, expression, identifiers, nodes from bigframes.session import polars_executor -from tests.system.small.engines.engine_utils import assert_equivalence_execution +from bigframes.testing.engine_utils import assert_equivalence_execution pytest.importorskip("polars") diff --git a/tests/system/small/functions/test_remote_function.py b/tests/system/small/functions/test_remote_function.py index 7fc7caf2fc..47ab6e2174 100644 --- a/tests/system/small/functions/test_remote_function.py +++ b/tests/system/small/functions/test_remote_function.py @@ -31,7 +31,7 @@ from bigframes.functions import _utils as bff_utils from bigframes.functions import function as bff import bigframes.session._io.bigquery -from tests.system.utils import assert_pandas_df_equal, get_function_name +from bigframes.testing.utils import assert_pandas_df_equal, get_function_name _prefixer = test_utils.prefixer.Prefixer("bigframes", "") diff --git a/tests/system/small/geopandas/test_geoseries.py b/tests/system/small/geopandas/test_geoseries.py index 36dd070ef5..51344edcbd 100644 --- a/tests/system/small/geopandas/test_geoseries.py +++ b/tests/system/small/geopandas/test_geoseries.py @@ -31,7 +31,7 @@ import bigframes.geopandas import bigframes.pandas import bigframes.series -from tests.system.utils import assert_series_equal +from bigframes.testing.utils import assert_series_equal @pytest.fixture(scope="session") diff --git a/tests/system/small/ml/test_cluster.py b/tests/system/small/ml/test_cluster.py index 96066e5fbe..4840329cda 100644 --- a/tests/system/small/ml/test_cluster.py +++ b/tests/system/small/ml/test_cluster.py @@ -16,7 +16,7 @@ from bigframes.ml import cluster import bigframes.pandas as bpd -from tests.system.utils import assert_pandas_df_equal +from bigframes.testing.utils import assert_pandas_df_equal _PD_NEW_PENGUINS = pd.DataFrame.from_dict( { diff --git a/tests/system/small/ml/test_core.py b/tests/system/small/ml/test_core.py index 3c5ba9bb18..ef62e5ddd3 100644 --- a/tests/system/small/ml/test_core.py +++ b/tests/system/small/ml/test_core.py @@ -23,7 +23,7 @@ import bigframes import bigframes.features from bigframes.ml import core -from tests.system import utils +from bigframes.testing import utils def test_model_eval( diff --git a/tests/system/small/ml/test_decomposition.py b/tests/system/small/ml/test_decomposition.py index 9eb9b25ea1..10255003a1 100644 --- a/tests/system/small/ml/test_decomposition.py +++ b/tests/system/small/ml/test_decomposition.py @@ -16,7 +16,7 @@ from bigframes.ml import decomposition import bigframes.pandas as bpd -import tests.system.utils +import bigframes.testing.utils def test_pca_predict( @@ -33,7 +33,7 @@ def test_pca_predict( index=pd.Index([1633, 1672, 1690], name="tag_number", dtype="Int64"), ) - tests.system.utils.assert_pandas_df_equal_pca( + bigframes.testing.utils.assert_pandas_df_equal_pca( predictions, expected, check_exact=False, rtol=0.1 ) @@ -161,7 +161,7 @@ def test_pca_components_(penguins_pca_model: decomposition.PCA): .reset_index(drop=True) ) - tests.system.utils.assert_pandas_df_equal_pca_components( + bigframes.testing.utils.assert_pandas_df_equal_pca_components( result, expected, check_exact=False, @@ -180,7 +180,7 @@ def test_pca_explained_variance_(penguins_pca_model: decomposition.PCA): "explained_variance": [3.278657, 1.270829, 1.125354], }, ) - tests.system.utils.assert_pandas_df_equal( + bigframes.testing.utils.assert_pandas_df_equal( result, expected, check_exact=False, @@ -200,7 +200,7 @@ def test_pca_explained_variance_ratio_(penguins_pca_model: decomposition.PCA): "explained_variance_ratio": [0.469357, 0.181926, 0.1611], }, ) - tests.system.utils.assert_pandas_df_equal( + bigframes.testing.utils.assert_pandas_df_equal( result, expected, check_exact=False, diff --git a/tests/system/small/ml/test_llm.py b/tests/system/small/ml/test_llm.py index 3d5453099d..11425400bf 100644 --- a/tests/system/small/ml/test_llm.py +++ b/tests/system/small/ml/test_llm.py @@ -22,7 +22,7 @@ from bigframes import exceptions from bigframes.ml import core, llm import bigframes.pandas as bpd -from tests.system import utils +from bigframes.testing import utils @pytest.mark.parametrize( diff --git a/tests/system/small/ml/test_multimodal_llm.py b/tests/system/small/ml/test_multimodal_llm.py index beee95636f..48a69f522c 100644 --- a/tests/system/small/ml/test_multimodal_llm.py +++ b/tests/system/small/ml/test_multimodal_llm.py @@ -18,7 +18,7 @@ from bigframes.ml import llm import bigframes.pandas as bpd -from tests.system import utils +from bigframes.testing import utils @pytest.mark.flaky(retries=2) diff --git a/tests/system/small/ml/test_preprocessing.py b/tests/system/small/ml/test_preprocessing.py index 16b153ab45..34be48be1e 100644 --- a/tests/system/small/ml/test_preprocessing.py +++ b/tests/system/small/ml/test_preprocessing.py @@ -19,7 +19,7 @@ import bigframes.features from bigframes.ml import preprocessing -from tests.system import utils +from bigframes.testing import utils ONE_HOT_ENCODED_DTYPE = ( pd.ArrowDtype(pa.list_(pa.struct([("index", pa.int64()), ("value", pa.float64())]))) diff --git a/tests/system/small/operations/test_datetimes.py b/tests/system/small/operations/test_datetimes.py index bbecf40e0b..4e2beb9c19 100644 --- a/tests/system/small/operations/test_datetimes.py +++ b/tests/system/small/operations/test_datetimes.py @@ -20,7 +20,7 @@ import pytest import bigframes.series -from tests.system.utils import assert_series_equal +from bigframes.testing.utils import assert_series_equal DATETIME_COL_NAMES = [("datetime_col",), ("timestamp_col",)] DATE_COLUMNS = [ diff --git a/tests/system/small/operations/test_lists.py b/tests/system/small/operations/test_lists.py index 7b39bdebd5..fda01a5dae 100644 --- a/tests/system/small/operations/test_lists.py +++ b/tests/system/small/operations/test_lists.py @@ -18,7 +18,7 @@ import pyarrow as pa import pytest -from ...utils import assert_series_equal +from bigframes.testing.utils import assert_series_equal @pytest.mark.parametrize( diff --git a/tests/system/small/operations/test_strings.py b/tests/system/small/operations/test_strings.py index 8801faf657..209bc87f9b 100644 --- a/tests/system/small/operations/test_strings.py +++ b/tests/system/small/operations/test_strings.py @@ -20,8 +20,7 @@ import bigframes.dtypes as dtypes import bigframes.pandas as bpd - -from ...utils import assert_series_equal +from bigframes.testing.utils import assert_series_equal def test_find(scalars_dfs): diff --git a/tests/system/small/regression/test_issue355_merge_after_filter.py b/tests/system/small/regression/test_issue355_merge_after_filter.py index 24ee01cb7f..1c3b6e4fe3 100644 --- a/tests/system/small/regression/test_issue355_merge_after_filter.py +++ b/tests/system/small/regression/test_issue355_merge_after_filter.py @@ -15,7 +15,7 @@ import pandas as pd import pytest -from tests.system.utils import assert_pandas_df_equal +from bigframes.testing.utils import assert_pandas_df_equal @pytest.mark.parametrize( diff --git a/tests/system/small/test_dataframe.py b/tests/system/small/test_dataframe.py index 18d8fed7dc..946df79cbf 100644 --- a/tests/system/small/test_dataframe.py +++ b/tests/system/small/test_dataframe.py @@ -33,7 +33,7 @@ import bigframes.dtypes as dtypes import bigframes.pandas as bpd import bigframes.series as series -from tests.system.utils import ( +from bigframes.testing.utils import ( assert_dfs_equivalent, assert_pandas_df_equal, assert_series_equal, diff --git a/tests/system/small/test_dataframe_io.py b/tests/system/small/test_dataframe_io.py index 5df7283e3c..afe3b53d6d 100644 --- a/tests/system/small/test_dataframe_io.py +++ b/tests/system/small/test_dataframe_io.py @@ -23,7 +23,7 @@ import pytest import bigframes.dtypes as dtypes -from tests.system import utils +from bigframes.testing import utils try: import pandas_gbq # type: ignore diff --git a/tests/system/small/test_encryption.py b/tests/system/small/test_encryption.py index 1ba8ed7e09..1f30df451d 100644 --- a/tests/system/small/test_encryption.py +++ b/tests/system/small/test_encryption.py @@ -21,7 +21,7 @@ import bigframes import bigframes.ml.linear_model -from tests.system import utils +from bigframes.testing import utils @pytest.fixture(scope="module") diff --git a/tests/system/small/test_groupby.py b/tests/system/small/test_groupby.py index bc2e9cc385..0af173adc8 100644 --- a/tests/system/small/test_groupby.py +++ b/tests/system/small/test_groupby.py @@ -16,7 +16,7 @@ import pytest import bigframes.pandas as bpd -from tests.system.utils import assert_pandas_df_equal +from bigframes.testing.utils import assert_pandas_df_equal # ================= # DataFrame.groupby diff --git a/tests/system/small/test_index.py b/tests/system/small/test_index.py index 7643f5701b..3b9854be26 100644 --- a/tests/system/small/test_index.py +++ b/tests/system/small/test_index.py @@ -19,7 +19,7 @@ import pytest import bigframes.pandas as bpd -from tests.system.utils import assert_pandas_index_equal_ignore_index_type +from bigframes.testing.utils import assert_pandas_index_equal_ignore_index_type def test_index_construct_from_list(): diff --git a/tests/system/small/test_large_local_data.py b/tests/system/small/test_large_local_data.py index eddec37132..0c03a8b6a3 100644 --- a/tests/system/small/test_large_local_data.py +++ b/tests/system/small/test_large_local_data.py @@ -17,7 +17,7 @@ import pytest import bigframes -from tests.system.utils import assert_pandas_df_equal +from bigframes.testing.utils import assert_pandas_df_equal large_dataframe = pd.DataFrame(np.random.rand(10000, 10), dtype="Float64") large_dataframe.index = large_dataframe.index.astype("Int64") diff --git a/tests/system/small/test_multiindex.py b/tests/system/small/test_multiindex.py index a01b7aab92..b63468d311 100644 --- a/tests/system/small/test_multiindex.py +++ b/tests/system/small/test_multiindex.py @@ -17,7 +17,7 @@ import pytest import bigframes.pandas as bpd -from tests.system.utils import assert_pandas_df_equal +from bigframes.testing.utils import assert_pandas_df_equal def test_multi_index_from_arrays(): diff --git a/tests/system/small/test_pandas.py b/tests/system/small/test_pandas.py index 491b56d5fc..4e8d3d20f7 100644 --- a/tests/system/small/test_pandas.py +++ b/tests/system/small/test_pandas.py @@ -21,7 +21,7 @@ import pytz import bigframes.pandas as bpd -from tests.system.utils import assert_pandas_df_equal +from bigframes.testing.utils import assert_pandas_df_equal @pytest.mark.parametrize( diff --git a/tests/system/small/test_series.py b/tests/system/small/test_series.py index 10671720af..6760d63a20 100644 --- a/tests/system/small/test_series.py +++ b/tests/system/small/test_series.py @@ -32,7 +32,7 @@ import bigframes.features import bigframes.pandas import bigframes.series as series -from tests.system.utils import ( +from bigframes.testing.utils import ( assert_pandas_df_equal, assert_series_equal, get_first_file_from_wildcard, diff --git a/tests/system/small/test_session.py b/tests/system/small/test_session.py index 9febb0da42..cbb441e5aa 100644 --- a/tests/system/small/test_session.py +++ b/tests/system/small/test_session.py @@ -36,7 +36,7 @@ import bigframes.dataframe import bigframes.dtypes import bigframes.ml.linear_model -from tests.system import utils +from bigframes.testing import utils all_write_engines = pytest.mark.parametrize( "write_engine", diff --git a/tests/system/small/test_unordered.py b/tests/system/small/test_unordered.py index f6a56af7ff..0825b78037 100644 --- a/tests/system/small/test_unordered.py +++ b/tests/system/small/test_unordered.py @@ -19,7 +19,7 @@ import bigframes.exceptions import bigframes.pandas as bpd -from tests.system.utils import assert_pandas_df_equal, assert_series_equal +from bigframes.testing.utils import assert_pandas_df_equal, assert_series_equal def test_unordered_mode_sql_no_hash(unordered_session): diff --git a/tests/unit/core/compile/sqlglot/conftest.py b/tests/unit/core/compile/sqlglot/conftest.py index 4d871fd707..83d6a2b881 100644 --- a/tests/unit/core/compile/sqlglot/conftest.py +++ b/tests/unit/core/compile/sqlglot/conftest.py @@ -19,7 +19,7 @@ import pytest from bigframes import dtypes -import tests.system.utils +import bigframes.testing.utils CURRENT_DIR = pathlib.Path(__file__).parent DATA_DIR = CURRENT_DIR.parent.parent.parent.parent / "data" @@ -27,7 +27,7 @@ @pytest.fixture(scope="session") def compiler_session(): - from . import compiler_session + from bigframes.testing import compiler_session return compiler_session.SQLCompilerSession() @@ -41,7 +41,7 @@ def scalars_types_pandas_df() -> pd.DataFrame: DATA_DIR / "scalars.jsonl", lines=True, ) - tests.system.utils.convert_pandas_dtypes(df, bytes_col=True) + bigframes.testing.utils.convert_pandas_dtypes(df, bytes_col=True) df = df.set_index("rowindex", drop=False) return df diff --git a/tests/unit/test_dataframe_polars.py b/tests/unit/test_dataframe_polars.py index 2bda563418..b434e473e9 100644 --- a/tests/unit/test_dataframe_polars.py +++ b/tests/unit/test_dataframe_polars.py @@ -30,7 +30,7 @@ import bigframes.dataframe as dataframe import bigframes.pandas as bpd import bigframes.series as series -from tests.system.utils import ( +from bigframes.testing.utils import ( assert_dfs_equivalent, assert_pandas_df_equal, assert_series_equal,