032: fix async get_dataset_linked_dashboard_count passed to asyncio.to_thread
get_dataset_linked_dashboard_count is async (coroutine function), but was passed to asyncio.to_thread() which expects a sync callable. This returned a coroutine object instead of an int, causing: '>' not supported between instances of 'coroutine' and 'int' Fix: await the async method directly inside asyncio.wait_for().
This commit is contained in:
@@ -312,9 +312,7 @@ class ResourceService:
|
||||
async with sem:
|
||||
try:
|
||||
return await asyncio.wait_for(
|
||||
asyncio.to_thread(
|
||||
client.get_dataset_linked_dashboard_count, ds_id
|
||||
),
|
||||
client.get_dataset_linked_dashboard_count(ds_id),
|
||||
timeout=10.0,
|
||||
)
|
||||
except (TimeoutError, Exception):
|
||||
|
||||
Reference in New Issue
Block a user