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

Fix aggregation query parameters to correctly replace keys in list #1035

Closed
wants to merge 1 commit into from

Conversation

yjcrocks
Copy link

This commit resolves #1025.

parse_aggregation_stage(st_value, key, value)
if key == st_value:
d[st_key] = value
if isinstance(d, list):

Choose a reason for hiding this comment

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

elif

d[st_key] = value
if isinstance(d, dict):
for st_key, st_value in d.items():
if isinstance(st_value, dict) or isinstance(st_value, list):

Choose a reason for hiding this comment

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

Can you create a method in order to avoid duplication?

if isinstance(st_value, dict) or isinstance(st_value, list):
parse_aggregation_stage(st_value, key, value)
if key == st_value:
d[st_idx] = value

Choose a reason for hiding this comment

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

Let us see what @nicolaiarocci says, but maybe it is worth to report it in the documentation related to the aggregation endpoint

@Amedeo91
Copy link

Amedeo91 commented Jul 6, 2017

Hi,

Can you please squash the commit into one? Btw, the continuos integration is failing! :)

Regards,
Amedeo

@nicolaiarocci
Copy link
Member

Hello, this is very nice. I am willing to merge. Would you also provide test coverage?

@nicolaiarocci nicolaiarocci added this to the 0.8 milestone Jul 22, 2017
@sergekir
Copy link
Contributor

Do you need some help with this issue? I've already experimented with aggregation parameters and also with adding pre_aggregation and on_fetched_aggregation hooks. Currently also without test coverage but I can write them.

@Amedeo91
Copy link

@idserge7: without test coverage I do not think @nicolaiarocci is willing to merge! But please, do your PR! :)

@sergekir
Copy link
Contributor

I'll cover it with tests first :)

@nicolaiarocci
Copy link
Member

Is anyone on test coverage for this?

@nicolaiarocci
Copy link
Member

Nevermind we have a similar PR with proper testing. Will go for that one instead: #1058

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Aggregation query parameter does not replace keys in the lists
4 participants