Deprecate _type from LeafDocLookup#37491
Conversation
|
Pinging @elastic/es-core-infra |
| public ScriptDocValues<?> get(Object key) { | ||
| // deprecate _type | ||
| if ("_type".equals(key)) { | ||
| DEPRECATION_LOGGER.deprecated(TYPES_DEPRECATION_MESSAGE); |
There was a problem hiding this comment.
I think this should be deprecatedAndMaybeLog
| public void testTypesDeprecation() { | ||
| ScriptDocValues<?> fetchedDocValues = docLookup.get("_type"); | ||
| assertEquals(docValues, fetchedDocValues); | ||
| assertWarnings("[types removal] Looking up doc types in scripts is deprecated."); |
There was a problem hiding this comment.
If this warning will be written out, then no need for a package private constant in leaf doc lookup.
jtibshirani
left a comment
There was a problem hiding this comment.
Looks good to me from the types deprecation side.
| public ScriptDocValues<?> get(Object key) { | ||
| // deprecate _type | ||
| if ("_type".equals(key)) { | ||
| DEPRECATION_LOGGER.deprecated(TYPES_DEPRECATION_MESSAGE); |
There was a problem hiding this comment.
Should we use deprecatedAndMaybeLog?
There was a problem hiding this comment.
:) already done. @rjernst mentioned the same thing.
|
@rjernst @jtibshirani Thanks for the reviews. Will commit as soon as CI passes. |
| public ScriptDocValues<?> get(Object key) { | ||
| // deprecate _type | ||
| if ("_type".equals(key)) { | ||
| DEPRECATION_LOGGER.deprecatedAndMaybeLog(TYPES_DEPRECATION_MESSAGE, TYPES_DEPRECATION_MESSAGE); |
There was a problem hiding this comment.
The first argument to deprecatedAndMaybeLog should be an arbitrary key uniquely identifying this deprecation point. Normally it would be something like type-field-doc-lookup.
|
@elasticmachine test this please |
|
@elasticmachine run gradle build tests 1 |
1 similar comment
|
@elasticmachine run gradle build tests 1 |
* master: Deprecate _type from LeafDocLookup (elastic#37491) Allow system privilege to execute proxied actions (elastic#37508) Update Put Watch to allow unknown fields (elastic#37494) AwaitsFix testAddNewReplicas SQL: Add protocol tests and remove jdbc_type from drivers response (elastic#37516) SQL: [Docs] Add an ES-SQL column for data types (elastic#37529) IndexMetaData#mappingOrDefault doesn't need to take a type argument. (elastic#37480) Simplify + Cleanup Dead Code in Settings (elastic#37341) Reject all requests that have an unconsumed body (elastic#37504) [Ml] Prevent config snapshot failure blocking migration (elastic#37493) Fix line length for aliases and remove suppression (elastic#37455) Add SSL Configuration Library (elastic#37287) SQL: Remove slightly used meta commands (elastic#37506) Simplify Snapshot Create Request Handling (elastic#37464) Remove the use of AbstracLifecycleComponent constructor elastic#37488 (elastic#37488) [ML] log minimum diskspace setting if forecast fails due to insufficient d… (elastic#37486)
This change deprecates _type within LeafDocLookup which is currently used by scripts to fetch the type of document. A recent change (#37281) allows this message to be logged from within scripts.