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

[Transform] Deprecation warnings do not get forwarded in preview #82935

Open
hendrikmuhs opened this issue Jan 24, 2022 · 1 comment
Open

[Transform] Deprecation warnings do not get forwarded in preview #82935

hendrikmuhs opened this issue Jan 24, 2022 · 1 comment
Assignees
Labels
>bug :ml/Transform Transform Team:ML Meta label for the ML team

Comments

@hendrikmuhs
Copy link
Contributor

hendrikmuhs commented Jan 24, 2022

The stack upgrade to 8.x lists deprecation's for painless: https://www.elastic.co/guide/en/elasticsearch/reference/8.0/migrating-8.0.html#breaking_80_painless_changes

When a user uses deprecated syntax the user should get warnings when he uses deprecated syntax. This works when issuing a query but not for _preview and PUT, repro steps below.

The issue mainly targets 7.17, however the fix should go into the main branch, too. There might be other deprecation's in the future. (however the latest 8.x, e.g. 8.1, is sufficient)

Note: The same applies for query runtime fields that can be defined as part of source.

Reproduction on a 7.17 build:

POST _transform/_preview
{
  "source": {
    "index": "kibana_sample_data_logs"
  },
  "pivot": {
    "group_by": {
      "@timestamp": {
        "date_histogram": {
          "field": "@timestamp",
          "calendar_interval": "1m"
        }
      }
    },
    "aggregations": {
      "bytes.avg": {
        "avg": {
          "field": "bytes"
        }
      },
      "millis": {
        "scripted_metric": {
          "init_script": "state.m = 0",
          "map_script": " state.m = doc['@timestamp'].value.millis;",
          "combine_script": "return state.m;",
          "reduce_script": """
          def last = 0; for (s in states) {last = s;} return last;      
          """
        }
      }
    }
  }
}

A query returns a warning:

GET kibana_sample_data_logs/_search
{
 "aggregations": {
      "bytes.avg": {
        "avg": {
          "field": "bytes"
        }
      },
      "millis": {
        "scripted_metric": {
          "init_script": "state.m = 0",
          "map_script": " state.m = doc['@timestamp'].value.millis;",
          "combine_script": "return state.m;",
          "reduce_script": """
          def last = 0; for (s in states) {last = s;} return last;      
          """
        }
      }
    } 
}
@elasticmachine elasticmachine added the Team:ML Meta label for the ML team label Jan 24, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :ml/Transform Transform Team:ML Meta label for the ML team
Projects
None yet
Development

No branches or pull requests

3 participants