Skip to content

Conversation

masseyke
Copy link
Member

@masseyke masseyke commented Sep 2, 2025

This fixes the effective_mapping field of the get data stream API to match what is described in the specification. That is, there is no longer a _doc field at the top level of the mapping.

@masseyke masseyke added >non-issue :Data Management/Data streams Data streams and their lifecycles v9.2.0 labels Sep 2, 2025
@masseyke masseyke marked this pull request as ready for review September 2, 2025 17:51
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

@elasticsearchmachine elasticsearchmachine added the Team:Data Management Meta label for data/management team label Sep 2, 2025
@masseyke masseyke requested review from Copilot and dakrone September 2, 2025 19:32
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR removes the _doc field from the top level of data stream effective mappings to align with the API specification. The change ensures that the effective_mapping field in the get data stream API response no longer contains an unnecessary _doc wrapper around the actual mapping properties.

Key Changes

  • Modified the getEffectiveMappings method to detect and unwrap _doc type placeholders from merged mappings
  • Updated all test files to expect effective mappings without the _doc wrapper
  • Removed unused DocumentMapper import

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
DataStream.java Implements logic to detect and remove _doc wrapper from effective mappings
250_data_stream_mappings.yml Updates YAML REST tests to expect mappings without _doc wrapper
TransportUpdateDataStreamMappingsActionIT.java Updates integration tests to use mappings without _doc structure
DataStreamIT.java Updates data stream integration tests to remove _doc from mapping definitions and expectations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@dakrone dakrone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM assuming CI is happy

@masseyke masseyke added auto-backport Automatically create backport pull requests when merged v9.1.4 labels Sep 3, 2025
@masseyke masseyke merged commit ae7bfd6 into elastic:main Sep 3, 2025
33 checks passed
@masseyke masseyke deleted the data-stream-mappings-no-doc branch September 3, 2025 19:21
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.1 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 134005

@masseyke masseyke removed auto-backport Automatically create backport pull requests when merged v9.1.4 labels Sep 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport pending :Data Management/Data streams Data streams and their lifecycles >non-issue Team:Data Management Meta label for data/management team v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants