Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: include return type in Interval component properties #8193

Merged
merged 2 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,26 @@ quartodoc:
- strftime
- time
- truncate
- IntervalValue
- name: IntervalValue
dynamic: true
members:
- to_unit
- negate
- __add__
- __sub__
- __mul__
- __floordiv__
NickCrews marked this conversation as resolved.
Show resolved Hide resolved
- years
- quarters
- months
- weeks
- days
- hours
- minutes
- seconds
- milliseconds
- microseconds
- nanoseconds
- DayOfWeek
- name: now
package: ibis
Expand Down
22 changes: 11 additions & 11 deletions ibis/expr/types/temporal.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,57 +833,57 @@ def to_unit(self, target_unit: str) -> IntervalValue:

@property
def years(self) -> ir.IntegerValue:
"""Extract the number of years from an interval."""
"""The number of years (IntegerValue)."""
return self.to_unit("Y")

@property
def quarters(self) -> ir.IntegerValue:
"""Extract the number of quarters from an interval."""
"""The number of quarters (IntegerValue)."""
return self.to_unit("Q")

@property
def months(self) -> ir.IntegerValue:
"""Extract the number of months from an interval."""
"""The number of months (IntegerValue)."""
return self.to_unit("M")

@property
def weeks(self) -> ir.IntegerValue:
"""Extract the number of weeks from an interval."""
"""The number of weeks (IntegerValue)."""
return self.to_unit("W")

@property
def days(self) -> ir.IntegerValue:
"""Extract the number of days from an interval."""
"""The number of days (IntegerValue)."""
return self.to_unit("D")

@property
def hours(self) -> ir.IntegerValue:
"""Extract the number of hours from an interval."""
"""The number of hours (IntegerValue)."""
return self.to_unit("h")

@property
def minutes(self) -> ir.IntegerValue:
"""Extract the number of minutes from an interval."""
"""The number of minutes (IntegerValue)."""
return self.to_unit("m")

@property
def seconds(self) -> ir.IntegerValue:
"""Extract the number of seconds from an interval."""
"""The number of seconds (IntegerValue)."""
return self.to_unit("s")

@property
def milliseconds(self) -> ir.IntegerValue:
"""Extract the number of milliseconds from an interval."""
"""The number of milliseconds (IntegerValue)."""
return self.to_unit("ms")

@property
def microseconds(self) -> ir.IntegerValue:
"""Extract the number of microseconds from an interval."""
"""The number of microseconds (IntegerValue)."""
return self.to_unit("us")

@property
def nanoseconds(self) -> ir.IntegerValue:
"""Extract the number of nanoseconds from an interval."""
"""The number of nanoseconds (IntegerValue)."""
return self.to_unit("ns")

def __add__(
Expand Down
Loading