Skip to content

Commit

Permalink
chore: add default value to host
Browse files Browse the repository at this point in the history
  • Loading branch information
mesejo committed Sep 27, 2024
1 parent f1f8f30 commit acab244
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion python/datafusion/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions python/datafusion/tests/test_sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion python/datafusion/tests/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit acab244

Please sign in to comment.