From 899bafd221f2e992aeb723e308c0062ce172a0e1 Mon Sep 17 00:00:00 2001 From: Anas Khan <83116240+anxkhn@users.noreply.github.com> Date: Sat, 4 Jul 2026 23:36:25 +0530 Subject: [PATCH] fix(dlt): always use destination_client for connection config The dlt destination-client selection gated the 1.10.0 API change with a string comparison (`dlt.__version__ >= "1.10.0"`). String comparison is lexicographic, so it wrongly evaluated "1.9.0" >= "1.10.0" (and "1.2.0", "1.5.10", ...) as True, sending every 1.x version down the >=1.10.0 branch. `destination_client()` is the public accessor on every realistically supported dlt version, and the pre-1.10 `_sql_job_client` fallback was already unreachable because of the same string-compare bug, so drop the version gate and always use `destination_client()`. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com> --- sqlmesh/integrations/dlt.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sqlmesh/integrations/dlt.py b/sqlmesh/integrations/dlt.py index e8c53e7efb..d9cced8deb 100644 --- a/sqlmesh/integrations/dlt.py +++ b/sqlmesh/integrations/dlt.py @@ -63,10 +63,7 @@ def generate_dlt_models_and_settings( if db_type == "filesystem": connection_config = None else: - if dlt.__version__ >= "1.10.0": - client = pipeline.destination_client() - else: - client = pipeline._sql_job_client(schema) # type: ignore + client = pipeline.destination_client() config = client.config credentials = config.credentials configs = {