Skip to content

Commit 19eee60

Browse files
authored
Fix semantic layer client blocking requests (#466)
1 parent 98c0020 commit 19eee60

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kind: Under the Hood
2+
body: Fix semantic layer client blocking requests
3+
time: 2025-12-03T12:59:39.630853-06:00

src/dbt_mcp/semantic_layer/client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import json
23
from collections.abc import Callable
34
from contextlib import AbstractContextManager
@@ -352,7 +353,8 @@ async def get_metrics_compiled_sql(
352353
parsed_order_by: list[OrderBySpec] = self._get_order_bys(
353354
order_by=order_by, metrics=metrics, group_by=group_by
354355
)
355-
compiled_sql = sl_client.compile_sql(
356+
compiled_sql = await asyncio.to_thread(
357+
sl_client.compile_sql,
356358
metrics=metrics,
357359
group_by=group_by, # type: ignore
358360
order_by=parsed_order_by, # type: ignore
@@ -392,7 +394,8 @@ async def query_metrics(
392394
parsed_order_by: list[OrderBySpec] = self._get_order_bys(
393395
order_by=order_by, metrics=metrics, group_by=group_by
394396
)
395-
query_result = sl_client.query(
397+
query_result = await asyncio.to_thread(
398+
sl_client.query,
396399
metrics=metrics,
397400
group_by=group_by, # type: ignore
398401
order_by=parsed_order_by, # type: ignore

0 commit comments

Comments
 (0)