Skip to content

Commit

Permalink
refactor[python]: Dispatch Series.dt.with_time_zone to Expr (#4701)
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Sep 3, 2022
1 parent d90f197 commit 27af78c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
2 changes: 0 additions & 2 deletions py-polars/polars/internals/series/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,6 @@ def cast_time_unit(self, tu: TimeUnit) -> pli.Series:
"""

# TODO: Dispatch to Expr
def with_time_zone(self, tz: str | None) -> pli.Series:
"""
Set time zone a Series of type Datetime.
Expand All @@ -276,7 +275,6 @@ def with_time_zone(self, tz: str | None) -> pli.Series:
Time zone for the `Datetime` Series.
"""
return pli.wrap_s(self._s.with_time_zone(tz))

def days(self) -> pli.Series:
"""
Expand Down
6 changes: 0 additions & 6 deletions py-polars/src/series.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,12 +1082,6 @@ impl PySeries {
}
}

pub fn with_time_zone(&self, tz: Option<TimeZone>) -> PyResult<Self> {
let mut dt = self.series.datetime().map_err(PyPolarsErr::from)?.clone();
dt.set_time_zone(tz);
Ok(dt.into_series().into())
}

pub fn set_at_idx(&mut self, idx: PySeries, values: PySeries) -> PyResult<()> {
// we take the value because we want a ref count
// of 1 so that we can have mutable access
Expand Down

0 comments on commit 27af78c

Please sign in to comment.