Skip to content

Commit

Permalink
feat: add py.typed to allow mypy to type check packages that use ibis
Browse files Browse the repository at this point in the history
In checking a package I am working on, I noticed the BaseBackend.table()
method was missing, and it appears this method should be available for
all backends, so I added an abc method for it.
  • Loading branch information
tswast committed Jan 23, 2023
1 parent 5bd4f09 commit 2116b09
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ibis/backends/base/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,23 @@ def list_tables(
The list of the table names that match the pattern `like`.
"""

@abc.abstractmethod
def table(self, name: str, database: str | None = None) -> ir.Table:
"""Construct a table expression.
Parameters
----------
name
Table name
database
Database name
Returns
-------
Table
Table expression
"""

@functools.cached_property
def tables(self):
"""An accessor for tables in the database.
Expand Down
Empty file added ibis/py.typed
Empty file.

0 comments on commit 2116b09

Please sign in to comment.