from __future__ import annotations from databend_driver import BlockingDatabendClient # Shared Cloud Lake (Databend) connector. Every loader writes to the same warehouse, so # the connection lives in common rather than per-loader; the load engines differ only in # how they read the object store (S3 vs GCS), not in how they reach Cloud Lake. def databend_dsn(dsn: str) -> str: if dsn.startswith("lake://"): return "databend://" + dsn.removeprefix("lake://") return dsn def client(config) -> BlockingDatabendClient: """Open a blocking Cloud Lake client. ``config`` is any load config exposing ``cloud_lake_dsn`` (duck-typed so both loaders and the setup runner share this).""" return BlockingDatabendClient(databend_dsn(config.cloud_lake_dsn))