032: fix missing await on async SupersetClient calls in resource_service.py
Found 3 missing 'await' keywords causing 'coroutine object is not iterable': - get_dashboards_summary() (line 57) - get_dashboards_summary_page() (line 114) - get_datasets_summary() (line 306) All three were calling async methods in sync context — returned coroutine objects instead of lists/dicts, causing iteration failures.
This commit is contained in:
@@ -54,7 +54,7 @@ class ResourceService:
|
|||||||
) -> list[dict[str, Any]]:
|
) -> list[dict[str, Any]]:
|
||||||
with belief_scope("get_dashboards_with_status", f"env={env.id}"):
|
with belief_scope("get_dashboards_with_status", f"env={env.id}"):
|
||||||
client = SupersetClient(env)
|
client = SupersetClient(env)
|
||||||
dashboards = client.get_dashboards_summary(require_slug=require_slug)
|
dashboards = await client.get_dashboards_summary(require_slug=require_slug)
|
||||||
|
|
||||||
# Enhance each dashboard with Git status and task status
|
# Enhance each dashboard with Git status and task status
|
||||||
result = []
|
result = []
|
||||||
@@ -111,7 +111,7 @@ class ResourceService:
|
|||||||
f"env={env.id}, page={page}, page_size={page_size}, search={search}",
|
f"env={env.id}, page={page}, page_size={page_size}, search={search}",
|
||||||
):
|
):
|
||||||
client = SupersetClient(env)
|
client = SupersetClient(env)
|
||||||
total, dashboards_page = client.get_dashboards_summary_page(
|
total, dashboards_page = await client.get_dashboards_summary_page(
|
||||||
page=page,
|
page=page,
|
||||||
page_size=page_size,
|
page_size=page_size,
|
||||||
search=search,
|
search=search,
|
||||||
@@ -303,7 +303,7 @@ class ResourceService:
|
|||||||
) -> list[dict[str, Any]]:
|
) -> list[dict[str, Any]]:
|
||||||
with belief_scope("get_datasets_with_status", f"env={env.id}"):
|
with belief_scope("get_datasets_with_status", f"env={env.id}"):
|
||||||
client = SupersetClient(env)
|
client = SupersetClient(env)
|
||||||
datasets = client.get_datasets_summary()
|
datasets = await client.get_datasets_summary()
|
||||||
|
|
||||||
# Enhance each dataset with task status and linked dashboard count
|
# Enhance each dataset with task status and linked dashboard count
|
||||||
sem = asyncio.Semaphore(3) # limit concurrent Superset calls
|
sem = asyncio.Semaphore(3) # limit concurrent Superset calls
|
||||||
|
|||||||
Reference in New Issue
Block a user