Instead of creating an empty, unpublished dashboard in the integration test to overwrite later. A temporary remote directory can be passed as parent path to the deploy dashboard:
Overwriting an empy, unpublished dashboard is a bit of hack
The remote directory can get a purge suffix so that it will be deleted by watch dog in case it is not cleaned up properly
Copy from ucx:
@pytest.fixture
def make_directory(ws, make_random):
def create(*, path: str | None = None):
if path is None:
path = f"/Users/{ws.current_user.me().user_name}/lsql-{make_random(4)}-{get_purge_suffix()}"
ws.workspace.mkdirs(path)
return path
yield from factory("directory", create, lambda x: ws.workspace.delete(x, recursive=True))
Instead of creating an empty, unpublished dashboard in the integration test to overwrite later. A temporary remote directory can be passed as parent path to the deploy dashboard:
Copy from ucx: