diff --git a/python/datafusion/context.py b/python/datafusion/context.py index 35a40ccd..e9f16496 100644 --- a/python/datafusion/context.py +++ b/python/datafusion/context.py @@ -449,7 +449,9 @@ def __init__( self.ctx = SessionContextInternal(config, runtime) - def register_object_store(self, schema: str, store: Any, host: str | None) -> None: + def register_object_store( + self, schema: str, store: Any, host: str | None = None + ) -> None: """Add a new object store into the session. Args: diff --git a/python/datafusion/tests/test_sql.py b/python/datafusion/tests/test_sql.py index 26d2388b..575c11e5 100644 --- a/python/datafusion/tests/test_sql.py +++ b/python/datafusion/tests/test_sql.py @@ -106,7 +106,7 @@ def test_register_csv(ctx, tmp_path): def test_register_http_csv(ctx): url = "https://raw.githubusercontent.com/ibis-project/testing-data/refs/heads/master/csv/diamonds.csv" - ctx.register_object_store("", Http(url), None) + ctx.register_object_store("", Http(url)) ctx.register_csv("remote", url) assert ctx.table_exist("remote") res, *_ = ctx.sql("SELECT COUNT(*) AS total FROM remote").to_pylist() @@ -462,7 +462,7 @@ def test_register_listing_table( dir_root = f"file://{dir_root}/" if path_to_str else dir_root - ctx.register_object_store("file://local", LocalFileSystem(), None) + ctx.register_object_store("file://local", LocalFileSystem()) ctx.register_listing_table( "my_table", dir_root, diff --git a/python/datafusion/tests/test_store.py b/python/datafusion/tests/test_store.py index 3ffd9ee4..d073c613 100644 --- a/python/datafusion/tests/test_store.py +++ b/python/datafusion/tests/test_store.py @@ -30,7 +30,7 @@ def local(): @pytest.fixture def ctx(local): ctx = SessionContext() - ctx.register_object_store("file://local", local, None) + ctx.register_object_store("file://local", local) return ctx