Skip to content

tests: fix failing e2e tests #726

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/system/large/ml/test_ensemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def test_randomforestclassifier_multiple_params(penguins_df_default_index, datas
f"{dataset_id}.temp_configured_randomforestclassifier_model"
in reloaded_model._bqml_model.model_name
)
assert reloaded_model.tree_method == "auto"
assert reloaded_model.tree_method.casefold() == "auto"
assert reloaded_model.colsample_bytree == 0.95
assert reloaded_model.colsample_bylevel == 0.95
assert reloaded_model.colsample_bynode == 0.95
Expand Down
23 changes: 5 additions & 18 deletions tests/system/large/test_remote_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import tempfile
import textwrap

from google.api_core.exceptions import BadRequest, InvalidArgument, NotFound
import google.api_core.exceptions
from google.cloud import bigquery, storage
import pandas
import pytest
Expand Down Expand Up @@ -849,7 +849,7 @@ def square(x):
expected_remote_function = f"{dataset_id}.{rf_name}"

# Initially the expected BQ remote function should not exist
with pytest.raises(NotFound):
with pytest.raises(google.api_core.exceptions.NotFound):
session.bqclient.get_routine(expected_remote_function)

# Create the remote function with the name provided explicitly
Expand Down Expand Up @@ -981,7 +981,7 @@ def test_internal(rf, udf):
expected_remote_function = f"{dataset_id}.{rf_name}"

# Initially the expected BQ remote function should not exist
with pytest.raises(NotFound):
with pytest.raises(google.api_core.exceptions.NotFound):
session.bqclient.get_routine(expected_remote_function)

# Create a new remote function with the name provided explicitly
Expand Down Expand Up @@ -1198,7 +1198,8 @@ def square(x):
scalars_df, _ = scalars_dfs

with pytest.raises(
BadRequest, match="400.*errorMessage.*unsupported operand type"
google.api_core.exceptions.BadRequest,
match="400.*errorMessage.*unsupported operand type",
):
# int64_col has nulls which should cause error in square
scalars_df["int64_col"].apply(square).to_pandas()
Expand Down Expand Up @@ -1431,20 +1432,6 @@ def square_num(x):
)


def test_remote_function_via_session_vpc_invalid(session):
with pytest.raises(
InvalidArgument, match="400.*Serverless VPC Access connector is not found"
):

@session.remote_function(
[int], int, reuse=False, cloud_function_vpc_connector="does-not-exist"
)
def square_num(x):
if x is None:
return x
return x * x


@pytest.mark.parametrize(
("max_batching_rows"),
[
Expand Down