fix(time-series): honour typeMapping for labels in RESP2 replies - #3412
Open
abhijeet117 wants to merge 1 commit into
Open
fix(time-series): honour typeMapping for labels in RESP2 replies#3412abhijeet117 wants to merge 1 commit into
abhijeet117 wants to merge 1 commit into
Conversation
Contributor
|
@abhijeet117 Thanks for the PR. We’ll review it when we have capacity. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ts.mGetWithLabels,ts.mGetSelectedLabelsand the twoWITHLABELS ... GROUPBYrange commands ignoredtypeMappingfor the labels map on RESP2. Both transformers pass it toresp2MapToValuefor the outer key map but calltransformRESP2Labels/transformRESP2LabelsWithSourceswithout it, although those helpers accept it. So withwithTypeMapping({ [RESP_TYPES.MAP]: Map })the outer container came back as aMapwhilelabelsstayed a plain object, diverging from RESP3 and fromts.mRangeSelectedLabels.Testing
Reproduced via
transformReply[2]with a synthetic RESP2 reply and{ [RESP_TYPES.MAP]: Map }:labelswas{ label: 'value' }instead ofMap(1) { 'label' => 'value' }. Added a regression test to each affected spec; both fail before the change and pass after. Type check and lint pass; replies withouttypeMappingare unchanged.Checklist
Note
Low Risk
Small reply-shape fix in time-series transformers; default object replies stay the same, only typeMapping users are affected.
Overview
RESP2
labelsmaps now respecttypeMapping(e.g.Map) instead of always being plain objects.createTransformMGetLabelsReplyand the WITHLABELS GROUPBY transformer passtypeMappingintotransformRESP2Labels/transformRESP2LabelsWithSources, matching the outer key map and RESP3. Default replies without a mapping are unchanged. Adds unit tests forTS.MGET WITHLABELSandTS.MRANGE WITHLABELS GROUPBY.Reviewed by Cursor Bugbot for commit 0c65f70. Bugbot is set up for automated code reviews on this repo. Configure here.