032: fix missing awaits in translate datasource endpoints (#5,6,7)

Three sync functions called async SupersetClient methods without await:
  - get_datasource_columns(): get_dataset_detail + get_database (async)
  - fetch_available_datasources(): get_datasets (async)
  - Route handlers: both calls missing await

Converted to async functions + added awaits. Both endpoints now return
proper data instead of coroutine errors.
This commit is contained in:
2026-06-04 23:57:46 +03:00
parent fe2602dc89
commit f6dc7c47e7
3 changed files with 7 additions and 7 deletions

View File

@@ -211,7 +211,7 @@ async def list_datasources(
with belief_scope("list_datasources"):
try:
service = TranslateJobService(db, config_manager)
datasets = service.fetch_available_datasources(env_id, search)
datasets = await service.fetch_available_datasources(env_id, search)
return datasets
except Exception as e:
logger.explore("list_datasources failed", extra={"src": "translate_routes", "error": str(e)})
@@ -231,7 +231,7 @@ async def get_datasource_columns(
extra={"src": "translate_routes"}
)
try:
result = fetch_datasource_columns_service(
result = await fetch_datasource_columns_service(
datasource_id=datasource_id,
env_id=env_id,
config_manager=config_manager,