Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .codegen.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"api_changelog": true,
"formatter": "go run golang.org/x/tools/cmd/goimports@latest -w $FILENAMES && go fmt ./...",
"version": {
"experimental/python/README.md": "version $VERSION or above",
"experimental/python/databricks/bundles/version.py": "__version__ = \"$VERSION\"",
"experimental/python/pyproject.toml": "version = \"$VERSION\"",
"experimental/python/uv.lock": "name = \"databricks-bundles\"\nversion = \"$VERSION\"",
"python/README.md": "version $VERSION or above",
"python/databricks/bundles/version.py": "__version__ = \"$VERSION\"",
"python/pyproject.toml": "version = \"$VERSION\"",
"python/uv.lock": "name = \"databricks-bundles\"\nversion = \"$VERSION\"",
"libs/template/templates/experimental-jobs-as-code/library/versions.tmpl": "{{define \"latest_databricks_bundles_version\" -}}$VERSION{{- end}}",
"libs/template/templates/default/library/versions.tmpl": "{{define \"latest_databricks_bundles_version\" -}}$VERSION{{- end}}"
},
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ jobs:
version: "0.6.5"

- name: Verify that python/codegen is up to date
working-directory: experimental/python
working-directory: python
run: |-
make codegen

if ! ( git diff --exit-code ); then
echo "Generated Python code is not up-to-date. Please run 'pushd experimental/python && make codegen' and commit the changes."
echo "Generated Python code is not up-to-date. Please run 'pushd python && make codegen' and commit the changes."

exit 1
fi
10 changes: 5 additions & 5 deletions .github/workflows/python_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
pull_request:
types: [opened, synchronize]
paths:
- experimental/python/**
- python/**
merge_group:
types: [checks_requested]
paths:
- experimental/python/**
- python/**
push:
# Always run on push to main. The build cache can only be reused
# if it was saved by a run from the repository's default branch.
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
version: "0.6.5"

- name: Run tests
working-directory: experimental/python
working-directory: python
run: make test

python_linters:
Expand All @@ -56,7 +56,7 @@ jobs:
version: "0.6.5"

- name: Run lint
working-directory: experimental/python
working-directory: python
run: make lint

python_docs:
Expand All @@ -73,5 +73,5 @@ jobs:
version: "0.6.5"

- name: Run docs
working-directory: experimental/python
working-directory: python
run: make docs
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ jobs:
version: "0.6.5"

- name: Build wheel
working-directory: experimental/python
working-directory: python
run: make build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
packages-dir: experimental/python/dist
packages-dir: python/dist
4 changes: 2 additions & 2 deletions .wsignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.codegen/_openapi_sha
.release_metadata.json
bundle/schema/jsonschema.json
experimental/python/docs/images/databricks-logo.svg
python/docs/images/databricks-logo.svg
**/*.dist-info/METADATA
**/*.dist-info/WHEEL

Expand All @@ -25,7 +25,7 @@ cmd/workspace/**/*.go
cmd/account/**/*.go

# Extra whitespace in generated Python models
experimental/python/databricks/bundles/*/_models/*.py
python/databricks/bundles/*/_models/*.py

# Developed elsewhere:
internal/genkit/tagging.py
Expand Down
2 changes: 1 addition & 1 deletion acceptance/acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ func buildDatabricksBundlesWheel(t *testing.T, buildDir string) string {
// so we prepare here by keeping only one.
_ = prepareWheelBuildDirectory(t, buildDir)

RunCommand(t, []string{"uv", "build", "--no-cache", "-q", "--wheel", "--out-dir", buildDir}, "../experimental/python")
RunCommand(t, []string{"uv", "build", "--no-cache", "-q", "--wheel", "--out-dir", buildDir}, "../python")

latestWheel := prepareWheelBuildDirectory(t, buildDir)
if latestWheel == "" {
Expand Down
2 changes: 1 addition & 1 deletion bundle/config/mutator/python/python_mutator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func TestGetOps_PyDABs(t *testing.T) {
},
}, PythonMutatorPhaseLoadResources)

assert.Error(t, err, "experimental/pydabs is deprecated, use experimental/python instead (https://docs.databricks.com/dev-tools/bundles/python)")
assert.Error(t, err, "experimental/pydabs is deprecated, use python instead (https://docs.databricks.com/dev-tools/bundles/python)")
}

func TestGetOps_empty(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion libs/dyn/dynvar/ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
var (
// !!! Should be in sync with _variable_regex in Python code.
// !!!
// !!! See experimental/python/databricks/bundles/core/_transform.py
// !!! See python/databricks/bundles/core/_transform.py
baseVarDef = `[a-zA-Z]+([-_]*[a-zA-Z0-9]+)*`
re = regexp.MustCompile(fmt.Sprintf(`\$\{(%s(\.%s(\[[0-9]+\])*)*(\[[0-9]+\])*)\}`, baseVarDef, baseVarDef))
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion experimental/python/README.md → python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Python for Databricks Asset Bundles extends [Databricks Asset Bundles](https://d

Documentation is available at https://docs.databricks.com/dev-tools/cli/databricks-cli.html.

Reference documentation is available at https://databricks.github.io/cli/experimental/python/
Reference documentation is available at https://databricks.github.io/cli/python/

## Getting started

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,9 @@ def _parse_bool(value) -> Optional[bool]:

def _load_spec() -> dict:
path = (
Path(__file__).parent # ./experimental/python/codegen/codegen
/ ".." # ./experimental/python/codegen
/ ".." # ./experimental/python/
/ ".." # ./experimental
Path(__file__).parent # ./python/codegen/codegen
/ ".." # ./python/codegen
/ ".." # ./python/
/ ".." # ./
/ "./bundle/schema/jsonschema.json"
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# All supported resource types and their namespace
RESOURCE_NAMESPACE = {
"resources.App": "apps",
"resources.Job": "jobs",
"resources.Pipeline": "pipelines",
"resources.Schema": "schemas",
Expand All @@ -15,11 +16,12 @@
#
# We can't load all types because of errors while loading some of them.
LOADED_NAMESPACES = [
"apps",
"catalog",
"compute",
"jobs",
"pipelines",
"resources",
"catalog",
]

RENAMES = {
Expand Down
File renamed without changes.
145 changes: 145 additions & 0 deletions python/databricks/bundles/apps/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
__all__ = [
"App",
"AppDict",
"AppParam",
"AppPermission",
"AppPermissionDict",
"AppPermissionLevel",
"AppPermissionLevelParam",
"AppPermissionParam",
"AppResource",
"AppResourceDatabase",
"AppResourceDatabaseDatabasePermission",
"AppResourceDatabaseDatabasePermissionParam",
"AppResourceDatabaseDict",
"AppResourceDatabaseParam",
"AppResourceDict",
"AppResourceGenieSpace",
"AppResourceGenieSpaceDict",
"AppResourceGenieSpaceGenieSpacePermission",
"AppResourceGenieSpaceGenieSpacePermissionParam",
"AppResourceGenieSpaceParam",
"AppResourceJob",
"AppResourceJobDict",
"AppResourceJobJobPermission",
"AppResourceJobJobPermissionParam",
"AppResourceJobParam",
"AppResourceParam",
"AppResourceSecret",
"AppResourceSecretDict",
"AppResourceSecretParam",
"AppResourceSecretSecretPermission",
"AppResourceSecretSecretPermissionParam",
"AppResourceServingEndpoint",
"AppResourceServingEndpointDict",
"AppResourceServingEndpointParam",
"AppResourceServingEndpointServingEndpointPermission",
"AppResourceServingEndpointServingEndpointPermissionParam",
"AppResourceSqlWarehouse",
"AppResourceSqlWarehouseDict",
"AppResourceSqlWarehouseParam",
"AppResourceSqlWarehouseSqlWarehousePermission",
"AppResourceSqlWarehouseSqlWarehousePermissionParam",
"AppResourceUcSecurable",
"AppResourceUcSecurableDict",
"AppResourceUcSecurableParam",
"AppResourceUcSecurableUcSecurablePermission",
"AppResourceUcSecurableUcSecurablePermissionParam",
"AppResourceUcSecurableUcSecurableType",
"AppResourceUcSecurableUcSecurableTypeParam",
"ComputeSize",
"ComputeSizeParam",
"Lifecycle",
"LifecycleDict",
"LifecycleParam",
]


from databricks.bundles.apps._models.app import App, AppDict, AppParam
from databricks.bundles.apps._models.app_permission import (
AppPermission,
AppPermissionDict,
AppPermissionParam,
)
from databricks.bundles.apps._models.app_permission_level import (
AppPermissionLevel,
AppPermissionLevelParam,
)
from databricks.bundles.apps._models.app_resource import (
AppResource,
AppResourceDict,
AppResourceParam,
)
from databricks.bundles.apps._models.app_resource_database import (
AppResourceDatabase,
AppResourceDatabaseDict,
AppResourceDatabaseParam,
)
from databricks.bundles.apps._models.app_resource_database_database_permission import (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are a bunch of fields with repetition app_resource_database_database_permission, app_resource_genie_space_genie_space_permission, ...

AppResourceDatabaseDatabasePermission,
AppResourceDatabaseDatabasePermissionParam,
)
from databricks.bundles.apps._models.app_resource_genie_space import (
AppResourceGenieSpace,
AppResourceGenieSpaceDict,
AppResourceGenieSpaceParam,
)
from databricks.bundles.apps._models.app_resource_genie_space_genie_space_permission import (
AppResourceGenieSpaceGenieSpacePermission,
AppResourceGenieSpaceGenieSpacePermissionParam,
)
from databricks.bundles.apps._models.app_resource_job import (
AppResourceJob,
AppResourceJobDict,
AppResourceJobParam,
)
from databricks.bundles.apps._models.app_resource_job_job_permission import (
AppResourceJobJobPermission,
AppResourceJobJobPermissionParam,
)
from databricks.bundles.apps._models.app_resource_secret import (
AppResourceSecret,
AppResourceSecretDict,
AppResourceSecretParam,
)
from databricks.bundles.apps._models.app_resource_secret_secret_permission import (
AppResourceSecretSecretPermission,
AppResourceSecretSecretPermissionParam,
)
from databricks.bundles.apps._models.app_resource_serving_endpoint import (
AppResourceServingEndpoint,
AppResourceServingEndpointDict,
AppResourceServingEndpointParam,
)
from databricks.bundles.apps._models.app_resource_serving_endpoint_serving_endpoint_permission import (
AppResourceServingEndpointServingEndpointPermission,
AppResourceServingEndpointServingEndpointPermissionParam,
)
from databricks.bundles.apps._models.app_resource_sql_warehouse import (
AppResourceSqlWarehouse,
AppResourceSqlWarehouseDict,
AppResourceSqlWarehouseParam,
)
from databricks.bundles.apps._models.app_resource_sql_warehouse_sql_warehouse_permission import (
AppResourceSqlWarehouseSqlWarehousePermission,
AppResourceSqlWarehouseSqlWarehousePermissionParam,
)
from databricks.bundles.apps._models.app_resource_uc_securable import (
AppResourceUcSecurable,
AppResourceUcSecurableDict,
AppResourceUcSecurableParam,
)
from databricks.bundles.apps._models.app_resource_uc_securable_uc_securable_permission import (
AppResourceUcSecurableUcSecurablePermission,
AppResourceUcSecurableUcSecurablePermissionParam,
)
from databricks.bundles.apps._models.app_resource_uc_securable_uc_securable_type import (
AppResourceUcSecurableUcSecurableType,
AppResourceUcSecurableUcSecurableTypeParam,
)
from databricks.bundles.apps._models.compute_size import ComputeSize, ComputeSizeParam
from databricks.bundles.apps._models.lifecycle import (
Lifecycle,
LifecycleDict,
LifecycleParam,
)
Loading