From 78dc036937ec414464ecda4f1a4e2058403b9aa1 Mon Sep 17 00:00:00 2001 From: Zhengbo Wang <77875500+luke396@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:06:08 +0800 Subject: [PATCH] ruff format --- py-polars/polars/_utils/construction/series.py | 4 +++- py-polars/tests/unit/series/test_series.py | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/py-polars/polars/_utils/construction/series.py b/py-polars/polars/_utils/construction/series.py index 211f58af0898..9c107bb695b7 100644 --- a/py-polars/polars/_utils/construction/series.py +++ b/py-polars/polars/_utils/construction/series.py @@ -412,7 +412,9 @@ def pandas_to_pyseries( if not name and values.name is not None: name = str(values.name) if is_simple_numpy_backed_pandas_series(values): - return pl.Series(name, values.to_numpy(), dtype=dtype, nan_to_null=nan_to_null)._s + return pl.Series( + name, values.to_numpy(), dtype=dtype, nan_to_null=nan_to_null + )._s if not _PYARROW_AVAILABLE: msg = ( "pyarrow is required for converting a pandas series to Polars, " diff --git a/py-polars/tests/unit/series/test_series.py b/py-polars/tests/unit/series/test_series.py index 9f3b8ec0d77c..8f770cd8da18 100644 --- a/py-polars/tests/unit/series/test_series.py +++ b/py-polars/tests/unit/series/test_series.py @@ -2338,6 +2338,7 @@ def test_search_sorted( multiple_s = s.search_sorted(multiple) assert_series_equal(multiple_s, pl.Series(multiple_expected, dtype=pl.UInt32)) -def test_series_from_pandas_with_dtype()->None: - s = pl.Series('foo', pd.Series([1,2,3]), pl.Float32) - assert_series_equal(s, pl.Series('foo', [1,2,3], dtype=pl.Float32)) + +def test_series_from_pandas_with_dtype() -> None: + s = pl.Series("foo", pd.Series([1, 2, 3]), pl.Float32) + assert_series_equal(s, pl.Series("foo", [1, 2, 3], dtype=pl.Float32))