Skip to content

DABs name_prefix manipulates strings in undesirable ways #2305

Description

@kyle-kent

Describe the issue

Setting a customname_prefix for DAB targets gets manipulated in an undesirable way. It truncates multiple _ down to one, and removes them entirely from the end of the string.

With a schema named qc, something as simple as name_prefix: ${workspace.current_user.short_name}_ (trailing underscore) gets manipulated to user_nameqc. No trailing underscore.

Configuration

# schemas.yaml
resources:
schemas:
qc:
name: qc
catalog_name: my_catalog
# databricks.yaml
targets:
dev:
mode: development
presets:
name_prefix: ${workspace.current_user.short_name}_

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. databricks bundle deploy -t dev

Expected Behavior

If user name is my_user then output should be my_catalog.my_user_qc.

If you allow custom inputs don't change them. We also use multiple underscores frequently. It for some reason convers __ to _.

Actual Behavior

If user name is my_user then output is my_catalog.my_userqc.

OS and CLI version

Databricks CLI v0.239.1
macos sequoia 15.3

Is this a regression?

Did this work in a previous version of the CLI? If so, which versions did you try?
Idk

Debug Logs

Output logs if you run the command with debug logs enabled. Example: databricks bundle deploy --log-level=debug. Redact if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    DABsDABs related issuesEnhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions