Commit Graph

2 Commits

Author SHA1 Message Date
shreyas-goenka 5948339f92
Add unit test for `command.ConfigUsed` (#2446)
## Changes
I forgot to add a unit test in the original PR, so adding it here:
https://github.com/databricks/cli/pull/2440

## Why
Unit testing code is a good practice. I believe we all should unit test
code.

## Tests
N/A

NO_CHANGELOG=true
2025-03-07 11:42:43 +00:00
shreyas-goenka 10b245d10c
Move `ConfigUsed` to `libs/command` (#2440)
## Changes
This PR moves `ConfigUsed` from the root package to `libs/command`.

## Why
Having the ConfigUsed function in the root package is a problem because
that means we cannot use that function from outside the `root` package
since doing so often leads to an import cycle (because `root` imports
everything implicitly).

Moving it to a separate package that consolidates the read interaction
and solves the import cycle issue. Example where this would have
simplified code:
https://github.com/databricks/cli/pull/2432#discussion_r1983368092

I'd like to send PRs to do the same for the workspace client and account
client as well. I'll wait however until this one is merged incase people
have concerns about the approach here.

## Tests
Existing tests.
2025-03-06 17:08:55 +00:00