From c0ae6844abbddbd6c3b953c204b3f237a78cc17d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 2 Nov 2024 13:13:38 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- narwhals/_pandas_like/dataframe.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/narwhals/_pandas_like/dataframe.py b/narwhals/_pandas_like/dataframe.py index 1c90eca79..6040da84b 100644 --- a/narwhals/_pandas_like/dataframe.py +++ b/narwhals/_pandas_like/dataframe.py @@ -699,15 +699,16 @@ def to_numpy(self, dtype: Any = None, copy: bool | None = None) -> Any: copy = self._implementation is Implementation.CUDF to_convert = { - key for key, val in self.schema.items() + key + for key, val in self.schema.items() if val == self._dtypes.Datetime and val.time_zone is not None # type: ignore[attr-defined] - } + } if to_convert: df = self.with_columns( - self.__narwhals_namespace__() - .col(list(to_convert)) - .dt.convert_time_zone("UTC") - .dt.replace_time_zone(None) + self.__narwhals_namespace__() + .col(list(to_convert)) + .dt.convert_time_zone("UTC") + .dt.replace_time_zone(None) )._native_frame else: df = self._native_frame