Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.
Merged
Changes from 1 commit
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
80 changes: 48 additions & 32 deletions ibis-server/app/routers/v3/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,22 @@ async def query(
"Failed to execute v3 query, try to fallback to v2: {}\n", str(e)
)
headers = append_fallback_context(headers, span)
return await v2.connector.query(
data_source=data_source,
dto=dto,
dry_run=dry_run,
cache_enable=cache_enable,
override_cache=override_cache,
limit=limit,
java_engine_connector=java_engine_connector,
query_cache_manager=query_cache_manager,
headers=headers,
is_fallback=True,
)
try:
return await v2.connector.query(
data_source=data_source,
dto=dto,
dry_run=dry_run,
limit=limit,
java_engine_connector=java_engine_connector,
headers=headers,
is_fallback=True,
cache_enable=cache_enable,
override_cache=override_cache,
query_cache_manager=query_cache_manager,
)
except Exception:
# ignore v2 error messages in fallback, return v3 error instead.
raise e
Comment thread
goldmedal marked this conversation as resolved.
Outdated


@router.post("/dry-plan", description="get the planned WrenSQL")
Expand Down Expand Up @@ -245,12 +249,16 @@ async def dry_plan(
"Failed to execute v3 dry-plan, try to fallback to v2: {}", str(e)
)
headers = append_fallback_context(headers, span)
return await v2.connector.dry_plan(
dto=dto,
java_engine_connector=java_engine_connector,
headers=headers,
is_fallback=True,
)
try:
return await v2.connector.dry_plan(
dto=dto,
java_engine_connector=java_engine_connector,
headers=headers,
is_fallback=True,
)
except Exception:
# ignore v2 error messages in fallback, return v3 error instead.
raise e
Comment thread
goldmedal marked this conversation as resolved.
Outdated


@router.post(
Expand Down Expand Up @@ -294,13 +302,17 @@ async def dry_plan_for_data_source(
str(e),
)
headers = append_fallback_context(headers, span)
return await v2.connector.dry_plan_for_data_source(
data_source=data_source,
dto=dto,
java_engine_connector=java_engine_connector,
headers=headers,
is_fallback=True,
)
try:
return await v2.connector.dry_plan_for_data_source(
data_source=data_source,
dto=dto,
java_engine_connector=java_engine_connector,
headers=headers,
is_fallback=True,
)
except Exception:
# ignore v2 error messages in fallback, return v3 error instead.
raise e
Comment thread
goldmedal marked this conversation as resolved.
Outdated


@router.post(
Expand Down Expand Up @@ -455,10 +467,14 @@ async def model_substitute(
str(e),
)
headers = append_fallback_context(headers, span)
return await v2.connector.model_substitute(
data_source=data_source,
dto=dto,
headers=headers,
java_engine_connector=java_engine_connector,
is_fallback=True,
)
try:
return await v2.connector.model_substitute(
data_source=data_source,
dto=dto,
headers=headers,
java_engine_connector=java_engine_connector,
is_fallback=True,
)
except Exception:
# ignore v2 error messages in fallback, return v3 error instead.
raise e
Comment thread
goldmedal marked this conversation as resolved.
Outdated
Loading