Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
luke396 committed Apr 29, 2024
1 parent b12edeb commit 78dc036
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion py-polars/polars/_utils/construction/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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, "
Expand Down
7 changes: 4 additions & 3 deletions py-polars/tests/unit/series/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit 78dc036

Please sign in to comment.