Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 2, 2024
1 parent b393e42 commit c0ae684
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions narwhals/_pandas_like/dataframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0ae684

Please sign in to comment.