From c221e770b02cc657ed592d856f1db27ebf6a0f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Va=C5=A1ko?= Date: Wed, 16 Sep 2026 07:50:03 +0200 Subject: [PATCH] fix(sync): restore the DS client factory default after CLI-13 (CLI-13) PR #759 (session-token support) replaced data_app_service.py's module-level _default_ds_client_factory with make_session_aware_client_factory(config_store, DataScienceClient), but left sync_service.py importing the removed name. Every command reachable through SyncService (pull/push/diff/status, and any command that imports keboola_agent_cli.cli or the server app at all) failed at import time with ImportError: cannot import name '_default_ds_client_factory' -- this broke CI on main across all three jobs (check, test, Windows wheel build) with 124-127 collection errors plus several failed tests wherever the import succeeded via a different path. Wire SyncService's DS client factory default through the same session-aware factory DataAppService already uses, so a browser-login session project's Storage/DS calls during pull/push work the same way CLI-13 intended everywhere else. The factory import is local to __init__ (not hoisted to the module-level .base import) to keep the file within its grandfathered file-size ceiling. --- src/keboola_agent_cli/services/sync_service.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/keboola_agent_cli/services/sync_service.py b/src/keboola_agent_cli/services/sync_service.py index 8f75940b0..0fa75e83f 100644 --- a/src/keboola_agent_cli/services/sync_service.py +++ b/src/keboola_agent_cli/services/sync_service.py @@ -114,11 +114,7 @@ stamp_updated_config, ) from .base import BaseService, ClientFactory, find_default_branch_id -from .data_app_service import ( - DATA_APP_COMPONENT_ID, - DataScienceClientFactory, - _default_ds_client_factory, -) +from .data_app_service import DATA_APP_COMPONENT_ID, DataScienceClient, DataScienceClientFactory logger = logging.getLogger(__name__) @@ -268,7 +264,11 @@ def __init__( # for ``keboola.data-apps`` configs, whose runtime type lives on the DS # ``/apps`` record and would otherwise be lost by pull/clone (CLI-8). super().__init__(config_store=config_store, client_factory=client_factory) - self._ds_client_factory = ds_client_factory or _default_ds_client_factory + from .base import make_session_aware_client_factory + + self._ds_client_factory = ds_client_factory or make_session_aware_client_factory( + config_store, DataScienceClient + ) # ------------------------------------------------------------------ # init