Skip to content

[ES|QL] BUCKET definition reports 3rd and 4th args as optional for 4-arg signatures #132592

@drewdaemon

Description

@drewdaemon

Elasticsearch Version

main

Installed Plugins

No response

Java Version

bundled

OS Version

n/a

Problem Description

In the definitions for Kibana, BUCKET reports the 3rd and 4th parameters as optional for signatures in which they are actually required.

For example, this one

  {
      "params" : [
        {
          "name" : "field",
          "type" : "date",
          "optional" : false,
          "description" : "Numeric or date expression from which to derive buckets."
        },
        {
          "name" : "buckets",
          "type" : "integer",
          "optional" : false,
          "description" : "Target number of buckets, or desired bucket size if `from` and `to` parameters are omitted."
        },
        {
          "name" : "from",
          "type" : "date",
          "optional" : true,
          "description" : "Start of the range. Can be a number, a date or a date expressed as a string."
        },
        {
          "name" : "to",
          "type" : "keyword",
          "optional" : true,
          "description" : "End of the range. Can be a number, a date or a date expressed as a string."
        }
      ],
      "variadic" : false,
      "returnType" : "date"
    },

This leads to the client-side validation not reporting errors for certain incorrect calls to BUCKET

image

Steps to Reproduce

Look at the file :)

Logs (if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions