Skip to content

databricks bundle deploy: How to remove workspace files that are no longer in source  #822

@PtrckGdwn

Description

@PtrckGdwn

Hi,

Databricks cli version .206

When running databricks bundle deploy I have noticed that when a file in a repo is removed (deleted or moved to a new directory) it is not removed from the workspace. For example:

  1. repo directory structure
- folder_a
  - file_a.py
- folder_b
  - file_b.py
  1. run databricks bundle deploy. Workspace directory looks like this (under the appropriate target files directory):
- folder_a
  - file_a.py
- folder_b
  - file_b.py
  1. In repo, move file_a.py to folder_b, and file_a.py to folder_a:
- folder_a
  - file_b.py
- folder_b
  - file_a.py
  1. run databricks bundle deploy. Workspace directory looks like this:
- folder_a
  - file_a.py
  - file_b.py
- folder_b
  - file_a.py
  - file_b.py

I would have expected (and in fact require) that the folder structure to reflect that in the repo.

Is the observed behaviour the expected behaviour? Or am I doing something wrong?

Is there some flag or option I can use for the bundle command to force file removal? (I cannot see when running databricks bundle deploy --help)

If it is the expected behaviour, and there is no option for force file removal, can this be added as a new feature? Otherwise, for deployments where files are moved around will require a manual step (or some fancy footwork with an sdk or the rest api) to clean up, which I would very much like to ignore.

Thanks, Pat

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions