Skip to content

Commit 26052dc

Browse files
authored
fix: warning in test explodes xdist (#9285)
Apparently a warning that xdist fails to deserialize kills the whole worker.
1 parent 970d039 commit 26052dc

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/_plugins/ui/_impl/tables/test_pandas_table.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,20 @@ def test_get_field_types(self) -> None:
773773
],
774774
]
775775

776+
# pandas 3 emits Pandas4Warning here (select_dtypes(include=["object"])
777+
# also picks up the new "str" dtype, for back-compat with pandas 2).
778+
# Suppress by message so this filter is a no-op on pandas 2, where
779+
# neither the "str" dtype nor Pandas4Warning exists. Necessary because
780+
# xdist's unserialize_warning_message fails to import pandas in the
781+
# controller on CI and the receiver thread treats that as a fatal
782+
# BaseException, killing the worker and cascading into hundreds of
783+
# fake failures.
784+
# TODO: fix xdist upstream — workermanage.py:462 should not tear down
785+
# the session when warning deserialization fails; wrap just the
786+
# unserialize call and fall back to a generic Warning.
787+
@pytest.mark.filterwarnings(
788+
"ignore:For backward compatibility, 'str' dtypes are included"
789+
)
776790
def test_get_field_types_nullables(self) -> None:
777791
data = pd.DataFrame(
778792
{

0 commit comments

Comments
 (0)