Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-stan committed Jul 20, 2023
1 parent 24c909d commit 03123d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion tests/integ/scala/test_udtf_suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def process(self) -> int:
with pytest.raises(ValueError) as ve:
session.udtf.register(MyWrongReturnTypeUDTF, output_schema=["c1"])
assert (
"The return type hint for a UDTF handler must but a collection type or a PandasDataFrame. <class 'int'> is used."
"The return type hint for a UDTF handler must be a collection type or a PandasDataFrame. <class 'int'> is used."
in str(ve.value)
)

Expand Down
3 changes: 0 additions & 3 deletions tests/integ/test_udtf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@

@pytest.fixture(scope="module")
def vectorized_udtf_test_table(session) -> str:
session.sql(
"alter session set python_udtf_enable_end_partition_dataframe_encoding = true;"
).collect()
# Input tabular data
table_name = Utils.random_table_name()
session.create_dataframe(
Expand Down
9 changes: 6 additions & 3 deletions tests/unit/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,13 +605,16 @@ def {func_name}(x: collections.defaultdict, y: Union[datetime.date, time]) -> Op
def {func_name}_{func_name}(x: int) -> int:
return x
"""
with pytest.raises(ValueError, match="function.*is not found in file"):
retrieve_func_type_hints_from_source("", func_name, _source=source)
# Func not found in file
assert retrieve_func_type_hints_from_source("", func_name, _source=source) is None

with pytest.raises(ValueError, match="class.*is not found in file"):
# Class not found in file
assert (
retrieve_func_type_hints_from_source(
"", func_name, class_name="FakeClass", _source=source
)
is None
)

source = f"""
def {func_name}() -> 1:
Expand Down

0 comments on commit 03123d7

Please sign in to comment.