Repository navigation
Conversation
…ntable text databricks_auth.workspace_client now builds the client fluid verify reads with (10 s on each HTTP attempt and of retries, the live check's bound) and the one the apply-time helpers use (databricks_enforce.default_client: 60 s on each attempt, and the SDK's own 300 s of retries, so a long throttle during a mask or row filter bind is waited out). Both used the SDK defaults, which the host metadata probe in Config() also used, so an unreachable host held fluid verify for about five minutes. A workspace's text reached the terminal with its escape sequences: in databricks-sdk's own warnings, such as the host metadata one, and in scrub and _scrub, which removed credentials but kept ESC, BEL and NUL. util.excerpt.printable replaces every character that is not printable with ?, the rule fluid diff used, which now calls it too. workspace_client puts a filter on databricks.sdk and on each of its child loggers before Config() runs. It redacts a record that holds such a character, by argument and over the whole message, before it replaces the character, so a tab or a no-break space a redaction pattern needs is still there. Both scrub helpers apply printable after their redaction. The timeouts bound each attempt, not a whole call: databricks-sdk 0.171.0 sleeps for a server's whole Retry-After and sends its OAuth token requests with no timeout. The docstring of workspace_client says so. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…efuses
fluid verify repeated an emitter refusal's message and remediation,
which can hold values resolved from {{ env.X }}. It now says that fluid
apply refuses the contract, names the refusal kind and points to fluid
validate for the reason, as fluid diff does. A test pins that a table
the emitter refuses over an env-resolved principal stays not verified,
with the value nowhere in the result.
Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
… warning databricks-sdk 0.171.0 warns when Config()'s host metadata probe fails and puts the probe's error after a colon, so a server's own message (one that names the caller, for example) reached stderr at the default level on every fluid doctor --live run against such a host. The SDK log filter now keeps the warning's first part and replaces the reason with a fixed text. A stand-in that answers 403 with the caller's name on every path shows no name in the log or in fluid doctor --live output. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
examples/databricks-unity-catalog holds one Unity Catalog table with a reader group. Its README names the environment the workspace and the credential come from, the USE CATALOG grant a catalog admin runs once for the reader group (fluid apply never grants on a catalog), and the commands from validate to verify. The strict-validate test finds it and exports the SQL warehouse a Databricks user always has. AGENTS.md describes the contract's shape: location.database is the catalog, and the workspace comes from the environment only. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…stand-in tests/iac/test_iac_databricks_examples_fake_e2e.py finds every examples/databricks-* contract and runs it with the real fluid CLI, tofu and the databricks/databricks provider against the in-process workspace: validate --strict, generate iac --validate, doctor --live, apply, a second plan that changes nothing, diff --exit-on-drift and verify --strict --require-every-port, after the USE CATALOG grant the README asks a catalog admin to run. The iac-tests stand-in lane runs it, and a change under examples/databricks-* now starts that workflow. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
With FLUID_LLM_PROVIDER=databricks and no DATABRICKS_API_BASE, litellm's databricks route asks databricks-sdk for the workspace and sends the key there. A project .env may set DATABRICKS_HOST next to its own DATABRICKS_TOKEN, so once a process had loaded the project's dotenv files, the key forge resolved (FLUID_LLM_API_KEY, the keyring or a saved setup) went to the workspace the project named. Both places forge calls litellm now check first: the one completion call every LLM request passes, and fluid ai setup's key check. A route listed in LITELLM_SDK_HOST_ROUTES, with no api_base and its base variable unset, is refused (copilot_llm_key_withheld) while a project dotenv file set the host the SDK reads, unless the key is the project's own FLUID_LLM_API_KEY. The error names the variable and how to point the provider at a workspace of your own; the staged agents do not retry it, and fluid ai test reports it as a setting to fix (exit 2). A classification test reads the installed litellm: every vendor SDK client its provider code builds takes its host from a variable an LLM group pairs with FLUID_LLM_API_KEY, or its provider is listed in the table. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
… operator A project .env may no longer set DBT_PROFILES_DIR, DBT_PROFILE, DBT_TARGET or DBT_PROJECT_DIR, nor the DBT_ENGINE_ forms dbt 1.11 and later read first. A profile names the host dbt connects to and the credentials it sends there, so a project file could pick another of the operator's profiles in ~/.dbt, or a profile outside the project. Nor may it turn on dbt's artifact upload (DBT_UPLOAD_TO_ARTIFACTS_INGEST_API), which posts the run's artifacts with the DBT_CLOUD_TOKEN in the environment to the host the project's own dbt_project.yml names. Each is ignored with the usual warning; the shell and CI may still set them. A profiles.yml the project supplies (in the dbt project, or in the contract's directory, where dbt looks when forge writes no profile) must resolve inside the project, symlinks followed: the contract's directory, a bundle's root, or the repository for a hybrid-reference build, unless that repository holds the operator's home directory. A build property profiles_dir, which no schema accepts and only an unvalidated caller can pass, gets the same rule. Anything else raises DbtProfileError before a profile is written or dbt starts, with the fix. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The examples' README runs fluid doctor --live and fluid verify, which read the workspace through databricks-sdk, as a user who follows it installs it. Stage 1 installed only the dev and test-emulators extras, so doctor reported the SDK missing and verify could not read the catalog grant. A lane may now name its own extras; the Databricks lane adds databricks. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
…one string diff and verify now import printable from util/excerpt, so _diff_live no longer re-exports it. The withheld-key hints in the error catalog are one string each, and the new LLM test imports the providers module one way. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
The new LLM test imports llm.providers before anything that loads llm.litellm_backend, which _backend() relies on; the import line now says so. Signed-off-by: Speculator55005 <50082482+fas89@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Four changes around Databricks and dbt credentials, one section each.
1. Databricks SDK clients: one factory, timeouts, printable text
databricks_auth.workspace_clientnow builds everyWorkspaceClient:fluid verify(_verify_databricks._default_client) reads with the live check's 10 s on each HTTP attempt, asfluid doctor --liveandfluid diffdo.databricks_enforce.default_client: masks and row filters, keys, metric views, Genie, loads, job and pipeline runs, test results and dashboards) use 60 s on each attempt, and keep the SDK's own 300 s of retries, so a long throttle during a mask or row filter bind, or its deny-all fallback, is waited out. A statement asks the server to wait at most 30 s, so its request fits.Config()also used. A host that did not answer heldfluid verifyfor about five minutes before its first read.?(databricks_auth.printable, the rulefluid diffprints server text by):databricks.sdklogger rewrites such a record. A filter on a logger does not see its children's records, so everydatabricks.sdk.*logger the SDK has made gets one, once each. It redacts the record first, by argument and over the whole message, while the tabs and no-break spaces a redaction pattern needs are still there.scruband_scrub, which every SDK and HTTP error message passes through. They removed credential values and joined lines, but kept ESC, BEL and NUL.?and not a spelled\xNN: the secret redactor runs after the log filter, on the handlers, and a spelled escape ends in a word character, which would hide aPASSWORD=right after it from the redactor's pattern.Config()'s host metadata probe fails and puts the probe's error after the colon, so a server's own message reached stderr at the default level on everyfluid doctor --liverun against such a host. Against a stand-in that answers 403 with the caller's name on every path, that name reached the output, which the doctor row promises never to show. The log filter now keeps the warning's first part and replaces the reason with a fixed text: "Failed to automatically resolve config from host metadata; using the explicit configuration."fluid verifynames only the refusal kind when the Databricks emitter raises a refusal while verify works out what apply provisions: "fluid apply refuses this contract (); run fluid validate on it for the reason". It used to repeat the emitter's message and remediation, which can hold values resolved from{{ env.X }}.fluid diffalready does this.2. A Databricks Unity Catalog example
examples/had no Databricks contract, and AGENTS.md named Databricks only in the cloud list.examples/databricks-unity-catalog/: one Unity Catalog table,garden.produce.harvests, with SELECT for one reader group. The README names the environment it needs (DATABRICKS_HOST, a credential,DATABRICKS_WAREHOUSE_ID), theUSE CATALOGgrant a catalog admin runs once for the reader group (fluid applynever grants on a catalog, and prints that statement), and the commands fromvalidatetoverify.tests/iac/test_iac_databricks_examples_fake_e2e.pyfinds everyexamples/databricks-*contract and runs its README's commands with the realfluidCLI,tofuand the databricks/databricks provider against the in-process workspace (tests/iac/_fake_databricks.py):validate --strict,generate iac --validate,doctor --live,apply, a second plan that changes nothing,diff --exit-on-driftandverify --strict --require-every-port.require:line) with thedatabricksextra installed, as the README's users have it (a lane may now name its own extras), and a change underexamples/databricks-*now starts that workflow.tests/test_examples_pass_strict_validate.pyexportsDATABRICKS_WAREHOUSE_IDfor a Databricks example, as its user would.location.databaseis the catalog, the workspace and credential come from the environment only, readers needUSE CATALOGfrom the catalog's admin, which commands read the live workspace, and that the example is the shape to start from (there is nofluid forgetemplate for Databricks).3. An LLM key goes only to a Databricks workspace you chose
With
FLUID_LLM_PROVIDER=databricksand noDATABRICKS_API_BASE, litellm's databricks route asks databricks-sdk for the workspace (WorkspaceClient().config.host) and sends the key there. A project.envmay setDATABRICKS_HOSTnext to its ownDATABRICKS_TOKEN(the Databricks endpoint group pairs them), so once a process had loaded the project's dotenv files, the key forge resolved (FLUID_LLM_API_KEY, the keyring or a saved setup) went to the workspace the project named.litellm_backend._completion_via_router_or_directis the one call every completion takes (call_llmblocking and streaming,fluid ai test, the staged agents,forge data-model --llm-provider), andfluid ai setup's key check (ai_setup._validate_api_key) runs the same check before its own call. A route listed inLITELLM_SDK_HOST_ROUTES(credentials/litellm_endpoints.py; today onlydatabricks), on a call with noapi_basewhile litellm's own base variable is unset, is refused while a project dotenv file supplied the host the SDK reads, unless the key in the call is the project's ownFLUID_LLM_API_KEY. litellm routes bycustom_llm_provider, else the model's prefix, and so does the check, soFLUID_LITELLM_MODEL_PREFIXcannot route around it.copilot_llm_key_withheld, names variables only: "Not sending your LLM key: a project dotenv file sets the Databricks workspace (DATABRICKS_HOST), and the databricks provider sends the key there when DATABRICKS_API_BASE is not set." Its fixes: exportDATABRICKS_API_BASE(your model serving endpoint) in your shell or CI environment; or exportDATABRICKS_HOSTfor your own workspace, which replaces the project's; or run the command outside this project. A catalog entry and the skills' error-code reference carry the same text. The staged agents do not retry it (failure_classwithheld, as for a rejected key), andfluid ai testreports it as a setting to fix (exit 2).DATABRICKS_API_BASEfrom the operator, or from the project paired with its ownFLUID_LLM_API_KEY; no project workspace in effect (the operator's ownDATABRICKS_HOST,~/.databrickscfg); a project's own key with its own workspace; a call with no key.fluid apply,verifyandpublishload a project's dotenv files, and so does the library engine (fluid_build.engine), which a host application runs in its own process before other forge calls; a plainfluid forgerun loads none. The check holds for any process that loads them and then calls the LLM.OpenAI,AzureOpenAI,WorkspaceClient, their async forms) takes its host from a variable an LLM endpoint group pairs withFLUID_LLM_API_KEY, or its provider is listed in the table. It fails on a route left out (checked by emptying the table), and checks the table against databricks-sdk's ownConfig.hostvariable.4. dbt's profile comes from inside the project, or from you
A dbt profile names the host dbt connects to and the credentials it sends there.
.envmay no longer setDBT_PROFILES_DIR,DBT_PROFILE,DBT_TARGETorDBT_PROJECT_DIR, nor theDBT_ENGINE_*forms dbt 1.11 and later read first (dbt 1.12.7dbt/cli/params.py). Before, it could pick another of the operator's profiles in~/.dbtor a profile outside the project. Each is ignored with the usual warning; the shell and CI may still set them, and a contract keepsbuild.properties.target.DBT_UPLOAD_TO_ARTIFACTS_INGEST_APIand itsDBT_ENGINE_form). In dbt 1.12.7 the upload posts the manifest and run results withAuthorization: Token $DBT_CLOUD_TOKENtohttps://<dbt-cloud.tenant_hostname>/api/private/accounts/..., the hostname read from the project's owndbt_project.yml(dbt/utils/artifact_upload.py); the switch is not adbt_project.ymlflag, so only the operator's shell or CI may turn it on.DBT_HOSTisdbt docs serve's bind address and sends nothing.profiles.ymlthe project supplies must resolve inside the project, symlinks followed: in the dbt project'sconfig/dbt/or root, and, when forge writes no profile for the platform, in the contract's directory, where dbt runs and looks first. Inside means the contract's directory, a bundle's root, or the repository for a hybrid-reference build, as for the dbt project itself (_path_safety.workspace_root_of), never a repository that holds the operator's home directory (a dotfiles repository): the nearest repository around the contract stands in for it, else the contract's directory. Anything else raisesDbtProfileErrorbefore a profile is written or dbt starts:It names the field, never the path. A profile directory the runner cannot read is handed to dbt, which reports it; forge raises no traceback.
profiles_diris in no schema (0.7.1 to 0.7.7 reject it), so a contract cannot carry it; a caller that runs builds without schema validation can, and it gets the same rule (resolved from the contract's directory, where dbt runs, and handed to dbt as that absolute path).DBT_PROFILES_DIR; profiles inside the project; the profile forge writes itself.Checked and left as they are
_verify_databricksretention check: a live Delta property that is not an interval is reported withrepr, which escapes control characters; a table property is not a credential._verify_databricksclient refusals (sdk_config): they name variables and hosts, never a credential value.databricks_enforce: a foreign row filter or mask names the live function (ForeignBinding), and a function mismatch names the live owner and parameters, with the body inrepr. Both are the workspace's own names, shown to the operator who runs the apply.databricks_metrics: a metric's aggregate that cannot be expressed repeats contract text, and the fail-safe note repeats ansdk_configrefusal.copilot/catalog/unity.pybuilds its own client from the catalog connection's credentials, not the apply credential, so it keeps its own path.litellm.completionin_completion_via_router_or_directand inai_setup._validate_api_key, both checked now. forge calls noacompletion,embedding,text_completion,responsesorRouter; its other litellm uses read local tables (model_cost,completion_cost,cost_per_token,token_counter). The coding-agent providers run an agent's own CLI, not litellm, and forge has no MCP sampling path any more.fluid ai setup's own choices cannot pick databricks today.dbt.prepare_profileactions carry aprofiles_diras plan text; the runner never reads it.Borrow
_preflight._LIVE_TIMEOUT_Sandworkspace_client, whichfluid doctor --liveandfluid diffalready use; the emitter'sRETRY_TIMEOUT_SECONDS;fluid diff'sprintable()rule and_console's note on redacting before spelling a control character;install_secret_redacting_filter's find-or-add idempotence; the import-linter contracts keep the filter out ofcli. No Databricks example existed (only a test stub);tests/test_examples_pass_strict_validate.pyalready finds every example;tests/test_aws_examples_e2e.pyis the per-cloud matrix this follows;tests/iac/_databricks_cli.pygives workspace isolation and the CLI runner.databricks.sdkin 56 modules and five children plususeragent; it offers no hook to clean its log text;http_timeout_secondsandretry_timeout_secondsare separateConfigvalues (60 and 300).loggingdocs: a logger's filter does not see records its descendants create. logging-formatter-anticrlf (BSD-2-Clause), richcontrol.py(MIT), OpenSSF pyscg-0022 and CWE-117 cover CR and LF only, so the filter is small and local.databricks_sql_tableanddatabricks_grants; Databricks Unity Catalog privilege docs (SELECT, USE SCHEMA, USE CATALOG); datacontract-cli's Databricks reference (MIT, v1.2.11); databricks/clilibs/testserver(Databricks License, idea only, no code taken).protected_env's endpoint groups anddotenv_store.project_supplied(the same testllm/coding_agent.pyuses to drop a project endpoint from an agent's environment);cli/ai_setup.py's withheld-key notice for the message's shape;tests/test_litellm_endpoint_names.py's scan of litellm's provider code for the classification test;tests/_dotenv_pairing_support.py's loopback listener and DNS guard.f2f507c3(2026-11-24, MIT), read in source: the databricks route still falls back toWorkspaceClient()in_get_databricks_credentialsand_get_api_base; an explicitapi_baseis the only thing that skips it; there is no switch, and no upstream issue or discussion of it. databricks-sdk 0.171.0:Config.hostreadsDATABRICKS_HOST, and ahost=argument would win, but litellm passes none.credentials "<host>"blocks (a token bound to one host, read only from the user's configuration), npm's per-registry//host/:_authToken._path_safety.resolve_workspace_rootandconfine_to_workspace(the dbt project directory's own confinement),DbtProfileErrorand the runner's refusal path for the generated profile's host;PROTECTED_ENV_KEYSand libpq's service-file precedent (PGSERVICE,PGSERVICEFILE) in it.--profiles-dir,--profile,--targetand--project-dirreadDBT_*, and 1.12 readsDBT_ENGINE_<X>first; the artifact upload indbt/utils/artifact_upload.pyanddbt/cli/requires.py; dbt docs on the profiles.yml lookup order.DbtCliResourceand astronomer-cosmos'sProfileConfig(both Apache-2.0) check only that a profiles location exists; neither confines it, so the check is forge's own, on Python's documentedPath.resolve()thenis_relative_to.Validation
examples/databricks-*), and the example's firstverify --strictfailed for want of the reader'sUSE CATALOG, which is how the README's admin step was found.fluid ai setup's key check, 2 for the retry and the exit code); the other 11 pin calls that must still go out and classify litellm's routes. Before the change, the loopback listener standing in for a project's workspace gotPOST /serving-endpoints/chat/completionswith the operator's key as the bearer, after twoGET /.well-known/databricks-config. Here the same probe ends incopilot_llm_key_withheld, and the listener records nothing.is_protected_env_keywas false for every dbt name, and a project.env'sDBT_PROFILES_DIRchose the profile; here it is ignored with the warning.tofu, the dbt runner, dotenv, protected-name, litellm, ai setup, retry and plan tests) ran on the two stacked together: 6,792 passed, 2 failed, the two overlay cases oftests/fragments/test_compat_gate.py, which fail onmaintoo, run alone (fluid bundle's stderr repeats its compile lines).lint-importsconfigurations and the fences: clean.mypy --strictonly its 3 rows inprofiler/consumer_queries/check.py, as on the base; bare mypy on the changed files adds 2 rows of a pattern_ai_setup_test.pyalready has 15 times (exit codes bound fromai_setupat import, which mypy cannot see), and one row moved a line.tests/perf/test_startup_budget.py: 11 passed.ripwire --quality-deltaon the base with this diff applied; a no-op control there reports no rows): 20 rows, each expected.workspace_client, and_default_clientmatching the shape of two unrelated lazy-import helpers (32 and 35 tokens).PROTECTED_ENV_KEYSby the ten dbt names and their comments,_GUIDANCEby the new event.-n 3, seed 868334584, 28 min): 56,860 passed, 47 failed, 13 errors, none caused by this change.mainadded for the profile history after this machine's environment was built. With scipy installed, the 10 files with a failure ran again: 469 passed, 7 failed.test_dbt_does_not_reload_the_project_dotenvfail onmaintoo, on this machine (no pandas, no dbt in the environment); the 2 overlay cases oftests/fragments/test_compat_gate.pyfail onmaintoo, run alone (fluid bundle's stderr repeats its compile lines).test_an_overlay_composed_from_fragments_is_applied_and_listedpassed on the second run.Known limits
test_the_host_metadata_warning_never_carries_the_server_s_messagefails, since it expects the fixed text. Other SDK warnings that repeat an error, such as a failed OAuth token refresh, are made printable and redacted but keep their text.--live's 10 s per attempt,fluid doctor --livewaits about 20 s before it reports the failure. databricks-sdk 0.171.0 has no switch to skip the probe.Retry-After, and sends its OAuth token and token exchange requests with no timeout. The comment atworkspace_clientnames both.FLUID_LOG_LEVEL=DEBUG). At that level the SDK's request and response dump becomes one line, its line breaks shown as?. A record's traceback is formatted after the filter and is not made printable (databricks-sdk 0.171.0 logs one only on its Azure CLI paths).profiles.ymlcommitted in the project still names its own host. That is a separate check.~/.dbt, and the dbt project's ownprofile:key picks one of its profiles. That is how dbt works, and it stays.Reviews
tofu1.13.1), drove item 3's states (the wire test fails with the check removed; the classification with an empty table namesllms/databricks/common_utils.py) and 30 profile-location cases for item 4, none of which escaped.profiles.ymldbt reads from its working directory when forge writes none. Its two LOW regressions are intended and named above: a project.envDBT_TARGETis ignored (usebuild.properties.target), andfluid verifyno longer repeats the emitter's remediation.fluidruns, cross-file contract; security left to the review above). Fixed here, each with a failing-first test: the refusal was retried three times by the staged agents;fluid ai testreported it as a resource problem (exit 4); theprofiles.ymlrefusal's fix named a field no schema allows; the hybrid-reference root above; an unreadable profiles directory raised a traceback. Stated in this body instead of changed: the build propertyprofiles_diris schema-rejected, and the LLM check applies where a process has loaded the project's dotenv files.Documentation
DATABRICKS_HOST), and the dbt and project.envpages (the protected dbt variables, the artifact upload switch, and where a project'sprofiles.ymlmay sit).