diff --git a/py-polars/polars/dataframe/frame.py b/py-polars/polars/dataframe/frame.py index d8687afc15f3..db1cf9b36482 100644 --- a/py-polars/polars/dataframe/frame.py +++ b/py-polars/polars/dataframe/frame.py @@ -8581,17 +8581,15 @@ def lazy(self) -> LazyFrame: """ Start a lazy query from this point. This returns a `LazyFrame` object. - Operations on a `LazyFrame` are not executed until this is requested by either - calling: + Operations on a `LazyFrame` are not executed until this is triggered + by calling one of: * :meth:`.collect() ` (run on all data) - * :meth:`.describe_plan() ` - (print unoptimized query plan) - * :meth:`.describe_optimized_plan() ` - (print optimized query plan) + * :meth:`.explain() ` + (print the query plan) * :meth:`.show_graph() ` - (show (un)optimized query plan as graphviz graph) + (show the query plan as graphviz graph) * :meth:`.collect_schema() ` (return the final frame schema) diff --git a/py-polars/polars/lazyframe/frame.py b/py-polars/polars/lazyframe/frame.py index c08d3c1ed0e1..8ce2a1d2e362 100644 --- a/py-polars/polars/lazyframe/frame.py +++ b/py-polars/polars/lazyframe/frame.py @@ -2841,7 +2841,7 @@ def lazy(self) -> LazyFrame: Return lazy representation, i.e. itself. Useful for writing code that expects either a :class:`DataFrame` or - :class:`LazyFrame`. + :class:`LazyFrame`. On LazyFrame this is a no-op, and returns the same object. Returns ------- diff --git a/py-polars/tests/unit/datatypes/test_temporal.py b/py-polars/tests/unit/datatypes/test_temporal.py index d08008bc8f41..1de1e08e74d4 100644 --- a/py-polars/tests/unit/datatypes/test_temporal.py +++ b/py-polars/tests/unit/datatypes/test_temporal.py @@ -2294,12 +2294,13 @@ def test_weekday_vs_stdlib_datetime( ) -> None: result = ( pl.Series([value], dtype=pl.Datetime(time_unit)) - .dt.replace_time_zone(time_zone) + .dt.replace_time_zone(time_zone, non_existent="null") .dt.weekday() .item() ) - expected = value.isoweekday() - assert result == expected + if result is not None: + expected = value.isoweekday() + assert result == expected @given(