Skip to content

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

Open
@stikkireddy

Description

@stikkireddy

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;
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions