-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import polars as pl | ||
from polars.testing import assert_series_equal | ||
|
||
|
||
def test_series_init_string() -> None: | ||
s = pl.Series(["a", "b"]) | ||
assert s.dtype == pl.String | ||
|
||
|
||
def test_utf8_alias_eq() -> None: | ||
assert pl.Utf8 == pl.String() | ||
assert pl.Utf8() == pl.String | ||
assert pl.Utf8() == pl.String() | ||
|
||
|
||
def test_utf8_alias_hash() -> None: | ||
assert hash(pl.Utf8()) == hash(pl.String()) | ||
|
||
|
||
def test_utf8_alias_series_init() -> None: | ||
s = pl.Series(["a", "b"], dtype=pl.Utf8) | ||
assert s.dtype == pl.String | ||
|
||
|
||
def test_utf8_alias_lit() -> None: | ||
result = pl.select(a=pl.lit(5, dtype=pl.Utf8)).to_series() | ||
expected = pl.Series("a", ["5"], dtype=pl.String) | ||
assert_series_equal(result, expected) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters