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.
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
[CM-380] Identical Aggregator #771
[CM-380] Identical Aggregator #771
Changes from 3 commits
7b72471
9c58d5c
2080f7b
332728e
86e8dfc
ee30401
fdf417c
f88a9b7
0554950
1c89fdb
dc37362
0c7cade
920340b
a156b08
4fa1cca
bfc79d1
f758a45
f56aed3
0612595
f6a9aa6
75f3f48
ba2d2f2
2ed5fc2
490e6df
0e2d430
fbc5b07
4aa0b5f
62e7bca
a1f8c4c
a6558d6
d946cbc
5150f85
3244162
369d2e7
76c6706
0e91007
bfdb8a6
9fc17a6
b0608fc
7abd311
449d79f
13de65e
ef71d0f
3cf5d9f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too happy with this approach... suggestions welcome.
@cedric-cordenier this is slightly different to what we discussed but I don't see how we can make a generic aggregator with only a single observation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like there needs to be a special case for a single observation to be just the object that's not keyed. This is our use case and I think most will be that way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about it too but unfortunately the return type of outcome is a Map, not a Value... hence the key overrides.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but if there's only one observation, the single observation's value should be a value.Value. That way the one observation can be unwrapped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I meant is that EncodableOutcome's type is values.Map so I can't assign Value to a Map... It needs at least one key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What I was thinking is that the outcome gets stored in a fixed struct:
Then you send the
Value
to the encoder.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, you can make this a value.Value. There's no reason someone can't encode a number, a list of numbers etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We actually assume that it needs to be a map since we add metadata to it. Any objection to leaving this as is and revisiting at a future date?