Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 3f180c3

Browse files
fix tests
1 parent 1eba9fe commit 3f180c3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/system/large/functions/test_managed_function.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@
3232
def function_id(dataset_id, session):
3333
name = prefixer.create_prefix()
3434
yield name
35-
session.bqclient.delete_routine(f"{dataset_id}.{name}")
35+
try:
36+
session.bqclient.delete_routine(f"{dataset_id}.{name}")
37+
# some tests, like test_managed_function_options_errors, should not actually create the function.
38+
# so we ignore the not found error.
39+
except google.api_core.exceptions.NotFound:
40+
pass
3641

3742

3843
def test_managed_function_array_output(session, scalars_dfs, dataset_id, function_id):
@@ -74,10 +79,6 @@ def featurize(x: int) -> list[float]:
7479

7580

7681
def test_managed_function_series_apply(session, dataset_id, scalars_dfs, function_id):
77-
# An explicit name with "def" in it is used to test the robustness of
78-
# the user code extraction logic, which depends on that term.
79-
assert "def" in function_id, "The substring 'def' was not found in 'function_id'"
80-
8182
@session.udf(dataset=dataset_id, name=function_id)
8283
def foo(x: int) -> bytes:
8384
return bytes(abs(x))

0 commit comments

Comments
 (0)