Skip to content

Commit

Permalink
move deprecated methods to bottom of file
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcoGorelli committed Nov 2, 2023
1 parent 2b18749 commit 842f705
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 154 deletions.
154 changes: 77 additions & 77 deletions py-polars/polars/expr/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1457,17 +1457,6 @@ def replace_time_zone(
self._pyexpr.dt_replace_time_zone(time_zone, ambiguous._pyexpr)
)

@deprecate_renamed_function("total_days", version="0.19.3")
def days(self) -> Expr:
"""
Extract the total days from a Duration type.
.. deprecated:: 0.19.3
Use :meth:`total_days` instead.
"""
return self.total_days()

def total_days(self) -> Expr:
"""
Extract the total days from a Duration type.
Expand Down Expand Up @@ -1507,17 +1496,6 @@ def total_days(self) -> Expr:
"""
return wrap_expr(self._pyexpr.duration_days())

@deprecate_renamed_function("total_hours", version="0.19.3")
def hours(self) -> Expr:
"""
Extract the total hours from a Duration type.
.. deprecated:: 0.19.3
Use :meth:`total_hours` instead.
"""
return self.total_hours()

def total_hours(self) -> Expr:
"""
Extract the total hours from a Duration type.
Expand Down Expand Up @@ -1558,17 +1536,6 @@ def total_hours(self) -> Expr:
"""
return wrap_expr(self._pyexpr.duration_hours())

@deprecate_renamed_function("total_minutes", version="0.19.3")
def minutes(self) -> Expr:
"""
Extract the total minutes from a Duration type.
.. deprecated:: 0.19.3
Use :meth:`total_minutes` instead.
"""
return self.total_minutes()

def total_minutes(self) -> Expr:
"""
Extract the total minutes from a Duration type.
Expand Down Expand Up @@ -1609,17 +1576,6 @@ def total_minutes(self) -> Expr:
"""
return wrap_expr(self._pyexpr.duration_minutes())

@deprecate_renamed_function("total_seconds", version="0.19.3")
def seconds(self) -> Expr:
"""
Extract the total seconds from a Duration type.
.. deprecated:: 0.19.3
Use :meth:`total_seconds` instead.
"""
return self.total_seconds()

def total_seconds(self) -> Expr:
"""
Extract the total seconds from a Duration type.
Expand Down Expand Up @@ -1662,17 +1618,6 @@ def total_seconds(self) -> Expr:
"""
return wrap_expr(self._pyexpr.duration_seconds())

@deprecate_renamed_function("total_milliseconds", version="0.19.3")
def milliseconds(self) -> Expr:
"""
Extract the total milliseconds from a Duration type.
.. deprecated:: 0.19.3
Use :meth:`total_milliseconds` instead.
"""
return self.total_milliseconds()

def total_milliseconds(self) -> Expr:
"""
Extract the total milliseconds from a Duration type.
Expand Down Expand Up @@ -1719,17 +1664,6 @@ def total_milliseconds(self) -> Expr:
"""
return wrap_expr(self._pyexpr.duration_milliseconds())

@deprecate_renamed_function("total_microseconds", version="0.19.3")
def microseconds(self) -> Expr:
"""
Extract the total microseconds from a Duration type.
.. deprecated:: 0.19.3
Use :meth:`total_microseconds` instead.
"""
return self.total_microseconds()

def total_microseconds(self) -> Expr:
"""
Extract the total microseconds from a Duration type.
Expand Down Expand Up @@ -1776,17 +1710,6 @@ def total_microseconds(self) -> Expr:
"""
return wrap_expr(self._pyexpr.duration_microseconds())

@deprecate_renamed_function("total_nanoseconds", version="0.19.3")
def nanoseconds(self) -> Expr:
"""
Extract the total nanoseconds from a Duration type.
.. deprecated:: 0.19.3
Use :meth:`total_nanoseconds` instead.
"""
return self.total_nanoseconds()

def total_nanoseconds(self) -> Expr:
"""
Extract the total nanoseconds from a Duration type.
Expand Down Expand Up @@ -2090,3 +2013,80 @@ def dst_offset(self) -> Expr:
└─────────────────────────────┴──────────────┘
"""
return wrap_expr(self._pyexpr.dt_dst_offset())

@deprecate_renamed_function("total_days", version="0.19.13")
def days(self) -> Expr:
"""
Extract the total days from a Duration type.
.. deprecated:: 0.19.13
Use :meth:`total_days` instead.
"""
return self.total_days()

@deprecate_renamed_function("total_hours", version="0.19.13")
def hours(self) -> Expr:
"""
Extract the total hours from a Duration type.
.. deprecated:: 0.19.13
Use :meth:`total_hours` instead.
"""
return self.total_hours()

@deprecate_renamed_function("total_minutes", version="0.19.13")
def minutes(self) -> Expr:
"""
Extract the total minutes from a Duration type.
.. deprecated:: 0.19.13
Use :meth:`total_minutes` instead.
"""
return self.total_minutes()

@deprecate_renamed_function("total_seconds", version="0.19.13")
def seconds(self) -> Expr:
"""
Extract the total seconds from a Duration type.
.. deprecated:: 0.19.13
Use :meth:`total_seconds` instead.
"""
return self.total_seconds()

@deprecate_renamed_function("total_milliseconds", version="0.19.13")
def milliseconds(self) -> Expr:
"""
Extract the total milliseconds from a Duration type.
.. deprecated:: 0.19.13
Use :meth:`total_milliseconds` instead.
"""
return self.total_milliseconds()

@deprecate_renamed_function("total_microseconds", version="0.19.13")
def microseconds(self) -> Expr:
"""
Extract the total microseconds from a Duration type.
.. deprecated:: 0.19.13
Use :meth:`total_microseconds` instead.
"""
return self.total_microseconds()

@deprecate_renamed_function("total_nanoseconds", version="0.19.13")
def nanoseconds(self) -> Expr:
"""
Extract the total nanoseconds from a Duration type.
.. deprecated:: 0.19.13
Use :meth:`total_nanoseconds` instead.
"""
return self.total_nanoseconds()
Loading

0 comments on commit 842f705

Please sign in to comment.