diff --git a/pandas/tests/io/test_fsspec.py b/pandas/tests/io/test_fsspec.py index 666da677d702e..f8081a6a69e83 100644 --- a/pandas/tests/io/test_fsspec.py +++ b/pandas/tests/io/test_fsspec.py @@ -24,10 +24,7 @@ "dt": date_range("2018-06-18", periods=2), } ) -# the ignore on the following line accounts for to_csv returning Optional(str) -# in general, but always str in the case we give no filename -# error: Item "None" of "Optional[str]" has no attribute "encode" -text = df1.to_csv(index=False).encode() # type: ignore[union-attr] +text = str(df1.to_csv(index=False)).encode() @pytest.fixture