Skip to content

Commit eb3304d

Browse files
committed
refactor: add type hints to register_schema and deregister_table methods
1 parent beb573b commit eb3304d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

python/datafusion/catalog.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ def database(self, name: str = "public") -> Schema:
8585
"""Returns the database with the given ``name`` from this catalog."""
8686
return self.schema(name)
8787

88-
def register_schema(self, name, schema) -> Schema | None:
88+
def register_schema(
89+
self,
90+
name: str,
91+
schema: Schema | SchemaProvider | SchemaProviderExportable,
92+
) -> Schema | None:
8993
"""Register a schema with this catalog."""
9094
if isinstance(schema, Schema):
9195
return self.catalog.register_schema(name, schema._raw_schema)
@@ -126,7 +130,7 @@ def table(self, name: str) -> Table:
126130
return Table(self._raw_schema.table(name))
127131

128132
def register_table(
129-
self, name, table: Table | TableProvider | TableProviderExportable
133+
self, name: str, table: Table | TableProvider | TableProviderExportable
130134
) -> None:
131135
"""Register a table or table provider in this schema.
132136
@@ -240,7 +244,7 @@ def register_table( # noqa: B027
240244
and treated as :class:`TableProvider` instances.
241245
"""
242246

243-
def deregister_table(self, name, cascade: bool) -> None: # noqa: B027
247+
def deregister_table(self, name: str, cascade: bool) -> None: # noqa: B027
244248
"""Remove a table from this schema.
245249
246250
This method is optional. If your schema provides a fixed list of tables, you do

0 commit comments

Comments
 (0)