032: fix coroutine never awaited in debug.py + task_logger.py

debug.py: _test_db_api and _get_dataset_structure were already async def
but called SupersetClient methods (authenticate, get_databases, get_dataset)
without await. Added await to 4 calls.

task_logger.py: _add_log callback is async def but _log() called it without
await, silently dropping all task log messages (RuntimeWarning: coroutine
never awaited). Changed to fire-and-forget via asyncio.ensure_future when
a running event loop is available, drops gracefully otherwise.
This commit is contained in:
2026-06-05 11:23:53 +03:00
parent 909b568784
commit 250b69db8c
2 changed files with 14 additions and 5 deletions

View File

@@ -167,8 +167,8 @@ class DebugPlugin(PluginBase):
raise ValueError(f"Environment '{name}' not found.")
client = SupersetClient(env_config)
client.authenticate()
count, dbs = client.get_databases()
await client.authenticate()
count, dbs = await client.get_databases()
log.debug(f"Found {count} databases in {name}")
results[name] = {
"count": count,
@@ -203,9 +203,9 @@ class DebugPlugin(PluginBase):
raise ValueError(f"Environment '{env_name}' not found.")
client = SupersetClient(env_config)
client.authenticate()
await client.authenticate()
dataset_response = client.get_dataset(dataset_id)
dataset_response = await client.get_dataset(dataset_id)
log.debug(f"Retrieved dataset structure for {dataset_id}")
return dataset_response.get('result') or {}
# endregion _get_dataset_structure