Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

databricks groups patch [group-id] --json "@user.json" returns Error: Endpoint not supported. #533

Closed
novablinkicelance opened this issue Jun 28, 2023 · 3 comments · Fixed by #535

Comments

@novablinkicelance
Copy link

Doing this in Azure Databricks. Other commands work well, but this, and a few others do not. Is this something that Azure needs to enable?

@mgyucht
Copy link
Contributor

mgyucht commented Jun 29, 2023

Thanks for reporting this. I was able to reproduce this. It seems to be an issue with generated code regarding argument parsing for this API. This has been added to our backlog and I'll begin investigating soon.

@mgyucht
Copy link
Contributor

mgyucht commented Jun 29, 2023

A quick update: we believe we have identified the core issue behind this bug. Currently, the templates used for generating the CLI command implementations assume that all parameters can be passed in the specified JSON object, but for this API and other APIs with path parameters, that assumption is not valid, as those parameters are excluded from the JSON object. We plan to get started working on the fix in the next week.

andrewnester added a commit that referenced this issue Jul 3, 2023
…vided (#535)

## Changes
When there are positional required parameters in the command which can't
be unmarshalled from JSON, we should require them despite the fact
`--json` flag is provided.

The reason is that for some of the command, for example, `databricks
groups patch ID` these arguments are actually path arguments in API and
can't be set as part of `--json` body provided.

Original change which introduced this ignore logic is here:
#405

Fixes #533,
#537

Note: Code generation is based on the change in this PR:
databricks/databricks-sdk-go#536

## Tests
1. Running `cli groups patch 123 --json {...}` works correctly

Backward compatibility tests with previous changes from
#405
1. `cli clusters events --json '{"cluster_id": "1029-xxxx"}'` - works,
returns list of events
2. `cli clusters events 1029-xxxx` - works, returns list of events
3. `cli clusters events` - works, first prompts for Cluster ID and then
returns the list of events
@andrewnester
Copy link
Contributor

Thanks for the reporting this. The change has been merged and will be released in the next CLI release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants