Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Jun 14, 2024
1 parent ceda989 commit 153b69c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
6 changes: 3 additions & 3 deletions py-polars/tests/unit/io/cloud/test_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ def test_read_s3(s3: str, function: Callable[..., Any], extension: str) -> None:
[(pl.scan_ipc, "ipc"), (pl.scan_parquet, "parquet")],
)
def test_scan_s3(s3: str, function: Callable[..., Any], extension: str) -> None:
df = function(
lf = function(
f"s3://bucket/foods1.{extension}",
storage_options={"endpoint_url": s3},
)
assert df.columns == ["category", "calories", "fats_g", "sugars_g"]
assert df.collect().shape == (27, 4)
assert lf.collect_schema().names() == ["category", "calories", "fats_g", "sugars_g"]
assert lf.collect().shape == (27, 4)


def test_lazy_count_s3(s3: str) -> None:
Expand Down
14 changes: 9 additions & 5 deletions py-polars/tests/unit/lazyframe/test_lazyframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import polars.selectors as cs
from polars import lit, when
from polars.datatypes import FLOAT_DTYPES
from polars.exceptions import PolarsInefficientMapWarning
from polars.exceptions import PerformanceWarning, PolarsInefficientMapWarning
from polars.testing import assert_frame_equal, assert_series_equal

if TYPE_CHECKING:
Expand Down Expand Up @@ -1382,7 +1382,11 @@ def test_lf_properties() -> None:
"ham": ["a", "b", "c"],
}
)
assert lf.schema == {"foo": pl.Int64, "bar": pl.Float64, "ham": pl.String}
assert lf.columns == ["foo", "bar", "ham"]
assert lf.dtypes == [pl.Int64, pl.Float64, pl.String]
assert lf.width == 3
with pytest.warns(PerformanceWarning):
assert lf.schema == {"foo": pl.Int64, "bar": pl.Float64, "ham": pl.String}
with pytest.warns(PerformanceWarning):
assert lf.columns == ["foo", "bar", "ham"]
with pytest.warns(PerformanceWarning):
assert lf.dtypes == [pl.Int64, pl.Float64, pl.String]
with pytest.warns(PerformanceWarning):
assert lf.width == 3
4 changes: 2 additions & 2 deletions py-polars/tests/unit/operations/arithmetic/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ def test_arithmetic_duration_div_multiply() -> None:
e=pl.col("a") * 2.5,
f=pl.col("a") / pl.col("a"), # a constant float
)
assert q.schema == pl.Schema(
assert q.collect_schema() == pl.Schema(
[
("a", pl.Duration(time_unit="us")),
("b", pl.Duration(time_unit="us")),
Expand Down Expand Up @@ -715,7 +715,7 @@ def test_arithmetic_duration_div_multiply() -> None:
b=2 * pl.col("a"),
c=2.5 * pl.col("a"),
)
assert q.schema == pl.Schema(
assert q.collect_schema() == pl.Schema(
[
("a", pl.Duration(time_unit="us")),
("b", pl.Duration(time_unit="us")),
Expand Down

0 comments on commit 153b69c

Please sign in to comment.