Skip to content

Commit ccd4206

Browse files
committed
[SPARK-56345][PYTHON][TESTS] Use pd.Series.__name__ in Arrow UDF type-hint test
### What changes were proposed in this pull request? This PR updates `python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py` to make the negative Arrow UDF type-hint assertion build the expected error pattern from `pd.Series.__name__` instead of hard-coding `pandas.core.series.Series`. The change is limited to the test expectation in `ArrowUDFTypeHintsTests.test_negative_with_pandas_udf`. ### Why are the changes needed? The previous assertion depended on a hard-coded fully qualified pandas type name. Building the expected pattern from `pd.Series.__name__` makes the test less coupled to a specific pandas type string representation while still checking that an unsupported pandas `Series` signature is rejected. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Updated the related test expectation. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #55175 from ueshin/issues/SPARK-56345/typehints. Authored-by: Takuya Ueshin <ueshin@databricks.com> Signed-off-by: Takuya Ueshin <ueshin@databricks.com>
1 parent 650b0a6 commit ccd4206

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

python/pyspark/sql/tests/arrow/test_arrow_udf_typehints.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ def test_negative_with_pandas_udf(self):
452452

453453
with self.assertRaisesRegex(
454454
Exception,
455-
"Unsupported signature:.*pandas.core.series.Series.",
455+
f"Unsupported signature:.*{pd.Series.__name__}.",
456456
):
457457

458458
@arrow_udf("long")

0 commit comments

Comments
 (0)