databricks-cli icon indicating copy to clipboard operation
databricks-cli copied to clipboard

Repos API update requires tags and repo_id but should only require one of those

Open ghost opened this issue 3 years ago • 1 comments

The func fails if you don't provide both but the assertion fails if both are provided. Branch and tag could be optional params to resolve. Easy fix I guess :)

https://github.com/databricks/databricks-cli/blob/main/databricks_cli/repos/api.py

def update(self, repo_id, branch, tag): """ Checks out the repo to the given branch or tag. Only one of branch or tag should be provided. """ assert bool(branch is not None) ^ bool(tag is not None) return self.client.update_repo(repo_id, branch, tag)

ghost avatar Jan 25 '23 05:01 ghost

Currently resolved like this by specifying tag= None and it works.

repos_api = ReposApi(api_client)

repo_id = repos_api.get_repo_id("/Repos/testing/hub.module") repos_api.update(repo_id, branch="snv6fe/dbutils", tag=None)

ghost avatar Jan 25 '23 05:01 ghost