Skip to content

bug: Incomplete type hint in Table.select, omits s.Selector #11511

@Azureuse

Description

@Azureuse

What happened?

I have read through the discussion in #6844 around type hints. The conclusion of this was a pragmatic approach to improving them in the codebase and to "Please open up bug reports for incorrect annotations as they arise!"

My knowledge of the ibis codebase is limited so apologies if I am incorrect here.

I think the type hint for Table.select( omits Selectors:

def select(
self,
*exprs: ir.Value | str | Iterable[ir.Value | str] | Deferred,
**named_exprs: ir.Value | str | Deferred,
) -> Table:

I think Table.order_by( takes a similar set of types and includes Selector:

def order_by(
self,
*by: str
| ir.Column
| s.Selector
| Deferred
| Sequence[str | ir.Column | s.Selector | Deferred],
) -> Table:

Should the type hint be the following?

    def select(
        self,
        *exprs: str | ir.Value | s.Selector | Deferred | Iterable[str | ir.Value | s.Selector | Deferred],
        **named_exprs: str | ir.Value | s.Selector | Deferred,
    ) -> Table:

What version of ibis are you using?

10.6.0

What backend(s) are you using, if any?

No response

Relevant log output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behavior inside of ibis

    Type

    No type

    Projects

    Status

    backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions