Skip to content

Commit

Permalink
chore: add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
ncclementi committed Aug 27, 2024
1 parent 82d7632 commit 2b5db1a
Showing 1 changed file with 88 additions and 4 deletions.
92 changes: 88 additions & 4 deletions ibis/backends/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,28 +137,112 @@ def _raise_if_not_implemented(self, method_name: str):
def list_tables(
self, like: str | None = None, database: tuple[str, str] | str | None = None
) -> list[str]:
"""Return the list of table names via the backend's implementation."""
"""Return the list of table names in a database via the backend's implementation.
::: {.callout-note}
## Ibis does not use the word `schema` to refer to database hierarchy.
A collection of tables is referred to as a `database`.
A collection of `database` is referred to as a `catalog`.
These terms are mapped onto the corresponding features in each
backend (where available), regardless of whether the backend itself
uses the same terminology.
:::
Parameters
----------
like
A pattern to use for listing tables.
database
Database to list tables from. Default behavior is to show tables in
the current database.
"""

self._raise_if_not_implemented("_list_tables")
return self._backend._list_tables(like=like, database=database)

def list_temp_tables(
self, like: str | None = None, database: tuple[str, str] | str | None = None
) -> list[str]:
"""Return the list of temporary table names via the backend's implementation."""
"""Return the list of temporary table names in a database via the backend's implementation.
::: {.callout-note}
## Ibis does not use the word `schema` to refer to database hierarchy.
A collection of tables is referred to as a `database`.
A collection of `database` is referred to as a `catalog`.
These terms are mapped onto the corresponding features in each
backend (where available), regardless of whether the backend itself
uses the same terminology.
:::
Parameters
----------
like
A pattern to use for listing tables.
database
Database to list tables from. Default behavior is to show tables in
the current database.
"""

self._raise_if_not_implemented("_list_temp_tables")
return self._backend._list_temp_tables(like=like, database=database)

def list_views(
self, like: str | None = None, database: tuple[str, str] | str | None = None
) -> list[str]:
"""Return the list of view names via the backend's implementation."""
"""Return the list of view names in a database via the backend's implementation.
::: {.callout-note}
## Ibis does not use the word `schema` to refer to database hierarchy.
A collection of tables is referred to as a `database`.
A collection of `database` is referred to as a `catalog`.
These terms are mapped onto the corresponding features in each
backend (where available), regardless of whether the backend itself
uses the same terminology.
:::
Parameters
----------
like
A pattern to use for listing tables.
database
Database to list tables from. Default behavior is to show tables in
the current database.
"""

self._raise_if_not_implemented("_list_views")
return self._backend._list_views(like=like, database=database)

def list_temp_views(
self, like: str | None = None, database: tuple[str, str] | str | None = None
) -> list[str]:
"""Return the list of temp view names via the backend's implementation."""
"""Return the list of temporary view names in a database via the backend's implementation.
::: {.callout-note}
## Ibis does not use the word `schema` to refer to database hierarchy.
A collection of tables is referred to as a `database`.
A collection of `database` is referred to as a `catalog`.
These terms are mapped onto the corresponding features in each
backend (where available), regardless of whether the backend itself
uses the same terminology.
:::
Parameters
----------
like
A pattern to use for listing tables.
database
Database to list tables from. Default behavior is to show tables in
the current database.
"""

self._raise_if_not_implemented("_list_temp_views")
return self._backend._list_temp_views(like=like, database=database)

Expand Down

0 comments on commit 2b5db1a

Please sign in to comment.