Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions arbalister/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,13 @@ def setup_route_handlers(web_app: jupyter_server.serverapp.ServerWebApplication)
context = dn.SessionContext(make_datafusion_config())

handlers = [
(url_path_join(base_url, r"arrow/stream/([^?]*)"), IpcRouteHandler, {"context": context}),
(url_path_join(base_url, r"arrow/stats/([^?]*)"), StatsRouteHandler, {"context": context}),
(url_path_join(base_url, r"file/info/([^?]*)"), FileInfoRouteHandler, {"context": context}),
(url_path_join(base_url, r"arbalister/arrow/stream/([^?]*)"), IpcRouteHandler, {"context": context}),
(url_path_join(base_url, r"arbalister/arrow/stats/([^?]*)"), StatsRouteHandler, {"context": context}),
(
url_path_join(base_url, r"arbalister/file/info/([^?]*)"),
FileInfoRouteHandler,
{"context": context},
),
]

web_app.add_handlers(host_pattern, handlers) # type: ignore[no-untyped-call]
6 changes: 3 additions & 3 deletions arbalister/tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async def test_ipc_route_limit(
) -> None:
"""Test fetching a file returns the limited rows and columns in IPC."""
response = await jp_fetch(
"arrow/stream",
"arbalister/arrow/stream",
str(table_file),
params={
k: v
Expand Down Expand Up @@ -209,7 +209,7 @@ async def test_stats_route(
) -> None:
"""Test fetching a file returns the correct metadata in Json."""
response = await jp_fetch(
"arrow/stats/",
"arbalister/arrow/stats/",
str(table_file),
params={k: v for k, v in dataclasses.asdict(file_params).items() if v is not None},
)
Expand All @@ -235,7 +235,7 @@ async def test_file_info_route_sqlite(
file_format: ff.FileFormat,
) -> None:
"""Test fetching file info for SQLite files returns table names."""
response = await jp_fetch("file/info/", str(table_file))
response = await jp_fetch("arbalister/file/info/", str(table_file))

assert response.code == 200
assert response.headers["Content-Type"] == "application/json; charset=UTF-8"
Expand Down
6 changes: 3 additions & 3 deletions src/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface FileInfoResponse {
}

export async function fetchFileInfo(params: Readonly<FileInfoOptions>): Promise<FileInfoResponse> {
const response = await fetch(`/file/info/${params.path}`);
const response = await fetch(`/arbalister/file/info/${params.path}`);
if (!response.ok) {
throw new Error(`Error communicating with the Arbalister server: ${response.status}`);
}
Expand Down Expand Up @@ -85,7 +85,7 @@ export async function fetchStats(
}
}

const response = await fetch(`/arrow/stats/${params.path}?${query.toString()}`);
const response = await fetch(`/arbalister/arrow/stats/${params.path}?${query.toString()}`);
if (!response.ok) {
throw new Error(`Error communicating with the Arbalister server: ${response.status}`);
}
Expand Down Expand Up @@ -154,7 +154,7 @@ export async function fetchTable(
}
}

const url = `/arrow/stream/${params.path}?${query.toString()}`;
const url = `/arbalister/arrow/stream/${params.path}?${query.toString()}`;
const response = await fetch(url);
if (!response.ok) {
throw new Error(`Error communicating with the Arbalister server: ${response.status}`);
Expand Down
Loading