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

Correcting the response format for ingest simulate #3640

Merged
merged 5 commits into from
Feb 4, 2025

Conversation

masseyke
Copy link
Member

This is an update to #3400. The simulate ingest response is fairly different from the simulate pipeline response, so I've pulled it into its own object.
Specifically, simulate ingest has an executed_pipelines array, and it does not have several fields that the simulate pipeline response has.

Copy link
Contributor

Following you can find the validation results for the API you have changed.

API Status Request Response
simulate.ingest 🔴 11/12 12/12

You can validate this API yourself by using the make validate target.

@masseyke masseyke requested a review from pquentin January 28, 2025 21:47
Copy link
Contributor

Following you can find the validation results for the API you have changed.

API Status Request Response
simulate.ingest 🔴 11/12 12/12

You can validate this API yourself by using the make validate target.

@l-trotta l-trotta self-assigned this Jan 31, 2025

export class Response {
body: { docs: SimulateDocumentResult[] }
}

export class SimulateDocumentResult {
Copy link
Contributor

Choose a reason for hiding this comment

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

we try to avoid duplicate names since it can break certain clients, could we rename this to something else? like SimulateIngestDocumentResult

*
* @behavior_meta AdditionalProperties fieldname=metadata description="Additional metadata"
*/
export class DocumentSimulation
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, coule be IngestDocumentSimulation?

/**
*
*/
_version?: Stringified<VersionNumber>
Copy link
Contributor

Choose a reason for hiding this comment

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

is _version actually nullable? checking the server code it seems like it's always added.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right -- I had just copy/pasted without looking.

Copy link
Member Author

Choose a reason for hiding this comment

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

I also realized that error was in the wrong place (it should be within the doc), and ignored_fields was missing altogether.

@masseyke masseyke requested a review from l-trotta January 31, 2025 23:41
Copy link
Contributor

Following you can find the validation results for the API you have changed.

API Status Request Response
simulate.ingest 🔴 11/12 12/12

You can validate this API yourself by using the make validate target.

* value is larger than the allowed limit would make it through all of the pipoelines, but
* would not be indexed into Elasticsearch.
*/
ignored_fields?: Array<Dictionary<IgnoredFieldKey, string>>
Copy link
Contributor

Choose a reason for hiding this comment

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

this dictionary is always just one "field" + string right? we have the type SingleKeyDictionary if so

Suggested change
ignored_fields?: Array<Dictionary<IgnoredFieldKey, string>>
ignored_fields?: Array<SingleKeyDictionary<IgnoredFieldKey, string>>

Copy link
Member Author

Choose a reason for hiding this comment

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

At the moment there is a single field. In the future we might expand this to include other fields such as reason. Should I go with SingleKeyDictionary for now and change it later? Or leave it as is?

Copy link
Contributor

Choose a reason for hiding this comment

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

let's leave it like this then

Copy link
Contributor

github-actions bot commented Feb 4, 2025

Following you can find the validation results for the API you have changed.

API Status Request Response
simulate.ingest 🔴 11/12 12/12

You can validate this API yourself by using the make validate target.

@masseyke masseyke requested a review from l-trotta February 4, 2025 16:16
Copy link
Contributor

@l-trotta l-trotta left a comment

Choose a reason for hiding this comment

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

LGTM!

@l-trotta l-trotta merged commit 03651cc into main Feb 4, 2025
12 checks passed
@l-trotta l-trotta deleted the fix-simulate-ingest-spec branch February 4, 2025 17:24
github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)
github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)
github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)
github-actions bot pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)
l-trotta pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)

Co-authored-by: Keith Massey <[email protected]>
l-trotta pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)

Co-authored-by: Keith Massey <[email protected]>
l-trotta pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)

Co-authored-by: Keith Massey <[email protected]>
l-trotta pushed a commit that referenced this pull request Feb 4, 2025
* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>
(cherry picked from commit 03651cc)

Co-authored-by: Keith Massey <[email protected]>
pquentin pushed a commit that referenced this pull request Feb 6, 2025
* [DOCS] Fix overlay for resolve cluster (#3670)

* Update specification output

* uppercase enum source mode (#3676)

* [DOCS] Add overlays for CCR API examples (#3672)

* Update inference.update.json with the correct verb (#3688)

* Update specification output

* [DOCS] Convert final examples from JSON to YAML (#3692)

* Update specification output

* Correcting the response format for ingest simulate (#3640)

* Correcting the response format for ingest simulate

* code review feedback

* moving error to the correct place, and adding ignored_fields

* Update specification/simulate/ingest/SimulateIngestResponse.ts

Co-authored-by: Laura Trotta <[email protected]>

---------

Co-authored-by: Laura Trotta <[email protected]>

* Update specification output

* Add text_embedding_bits to inference result output (#3698)

* Update specification output

* Improve `Analyzer` definitions and fix various classes (#3215)

* Update specification output

---------

Co-authored-by: Lisa Cawley <[email protected]>
Co-authored-by: Elastic Machine <[email protected]>
Co-authored-by: Laura Trotta <[email protected]>
Co-authored-by: David Kyle <[email protected]>
Co-authored-by: Keith Massey <[email protected]>
Co-authored-by: Ying Mao <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants