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

[ISSUE] Bad request error when using QueryEndpointInput with Inputs #317

Open
stikkireddy opened this issue Jul 22, 2024 · 0 comments
Open

Comments

@stikkireddy
Copy link

Description
When using the inputs field only the inputs field is allowed and nothing more. Otherwise the server fails to parse the inputs.

Reproduction

import com.databricks.sdk.WorkspaceClient;
import com.databricks.sdk.service.serving.QueryEndpointInput;

WorkspaceClient workspace = new WorkspaceClient(config);
        int[][] sampleInputs = {
            {1, 2, 3},
            {4, 5, 6},
            {7, 8, 9}
        };
QueryEndpointInput queryEndpointInput = new QueryEndpointInput()
          .setInputs(sampleInputs)
          .setName("test");
workspace.servingEndpoints().query(queryEndpointInput);

Expected behavior
It sends name as part of the input and the server throws an error which if you send inputs you cannot send any other field as part of the payload including name. Name gets sent over.

Is it a regression?
I tried 0.27.0.

Additional context
I fixed it by using the following class which uses json ignore for the name for querying:

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.databricks.sdk.service.serving.QueryEndpointInput;

class CustomQueryEndpointInput extends QueryEndpointInput {
    @Override
    @JsonIgnore
    public String getName() {
        return super.getName();
    }

    @Override
    public QueryEndpointInput setName(String name) {
        super.setName(name);
        return this;
    }
}
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

No branches or pull requests

1 participant