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:
@@ -234,13 +234,13 @@ class TranslateJobService:
|
||||
|
||||
# region fetch_available_datasources [TYPE Function]
|
||||
# @PURPOSE: List available Superset datasets for translation job creation.
|
||||
def fetch_available_datasources(self, env_id: str, search: str | None = None) -> list:
|
||||
async def fetch_available_datasources(self, env_id: str, search: str | None = None) -> list:
|
||||
from ...core.superset_client import SupersetClient
|
||||
env = self.config_manager.get_environment(env_id)
|
||||
if not env:
|
||||
raise ValueError(f"Environment '{env_id}' not found")
|
||||
client = SupersetClient(env)
|
||||
_, datasets = client.get_datasets()
|
||||
_, datasets = await client.get_datasets()
|
||||
result = []
|
||||
for ds in datasets:
|
||||
name = ds.get("table_name", "")
|
||||
|
||||
Reference in New Issue
Block a user