ibis icon indicating copy to clipboard operation
ibis copied to clipboard

docs: include return type in Interval.years, .months, etc

Open NickCrews opened this issue 1 year ago • 1 comments

Fixes https://github.com/ibis-project/ibis/issues/8165

NickCrews avatar Feb 01 '24 22:02 NickCrews

@NickCrews Thanks for the PR. Is there any chance that instead of this approach we can add these methods and properties individually to _quarto.yml (likely requiring dynamic: true for each of them)?

cpcloud avatar Feb 05 '24 11:02 cpcloud

Per this thread, if I try

@public
class IntervalValue(Value):
    quarters: ir.IntegerValue
    """The number of quarters"""

    @property
    def quarters(self) -> ir.IntegerValue:
        return self.to_unit("Q")

it generates (note no docstring)

| Name | Description |
| --- | --- |
| [quarters](#ibis.expr.types.temporal.IntervalValue.quarters) |  |

Probably this is something to do with the metapgrogramming of Value using the class type annotations? So seems like this workaround won't work for us at all.

From reading that thread, I think I have come to the conclusion that my current implementation is the only way to do this currently.

NickCrews avatar Mar 05 '24 19:03 NickCrews

I think this is still a gradual improvement, even if it isn't ideal. I think it shouldn't be bad to reverse or improve this later if this functionality changes. At the least, it adds __add__ documentation, which was missing.

NickCrews avatar Mar 05 '24 19:03 NickCrews