Skip to content

Commit

Permalink
docs: include return type in Interval.years, .months, etc
Browse files Browse the repository at this point in the history
Fixes #8165
  • Loading branch information
NickCrews committed Feb 1, 2024
1 parent 24643dc commit 3e19ca2
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions ibis/expr/types/temporal.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
from __future__ import annotations

import datetime
from typing import TYPE_CHECKING, Literal, Any
from typing import TYPE_CHECKING, Any, Literal

from public import public

import ibis
import ibis.expr.datashape as ds
import ibis.expr.operations as ops
from ibis.expr.types.core import _binop
from ibis.expr.types.generic import Column, Scalar, Value
from ibis.common.annotations import annotated
import ibis.expr.datatypes as dt
import ibis.expr.operations as ops
from ibis import util
from ibis.common.annotations import annotated
from ibis.common.temporal import IntervalUnit
from ibis.expr.types.core import _binop
from ibis.expr.types.generic import Column, Scalar, Value

if TYPE_CHECKING:
import pandas as pd
Expand Down Expand Up @@ -812,57 +812,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

0 comments on commit 3e19ca2

Please sign in to comment.