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

Merge select one and select multiple options at MergedXform creation #2015

Merged
merged 1 commit into from
Feb 22, 2021

Conversation

FrankApiyo
Copy link
Member

@FrankApiyo FrankApiyo commented Feb 11, 2021

Closes #2016

Changes proposed

  • Revert changes made here and instead merge select one and select multiple options at MergedXform creation(in the serializer). This is better because it would work for all the endpoints that make use of these options (not only the charts endpoint)

NB: Earlier added tests for the charts endpoints and all existing test should still pass

@FrankApiyo FrankApiyo changed the title Check when field is a dict before accessing it's properties [WIP]Check when field is a dict before accessing it's properties Feb 12, 2021
@FrankApiyo FrankApiyo removed the request for review from ivermac February 12, 2021 08:50
@FrankApiyo FrankApiyo changed the title [WIP]Check when field is a dict before accessing it's properties Merge select one and select multiple options at MergedXform creation Feb 16, 2021
@FrankApiyo FrankApiyo changed the title Merge select one and select multiple options at MergedXform creation [WIP]Merge select one and select multiple options at MergedXform creation Feb 16, 2021
@FrankApiyo FrankApiyo changed the title [WIP]Merge select one and select multiple options at MergedXform creation Merge select one and select multiple options at MergedXform creation Feb 16, 2021
@FrankApiyo FrankApiyo force-pushed the charts-endpoint-hotfix branch 6 times, most recently from 90c58b4 to 322fc88 Compare February 22, 2021 08:18
DavisRayM
DavisRayM previously approved these changes Feb 22, 2021
Copy link
Contributor

@ivermac ivermac left a comment

Choose a reason for hiding this comment

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

It's getting close

Comment on lines 90 to 92
if element_list:
element = element_list[0]
children += element['children']
Copy link
Contributor

Choose a reason for hiding this comment

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

For line 92, is it correct to assume that element will always be a non-empty dictionary with a children key? What would happen in line 92 if element_list in line 90 is empty?

Copy link
Member Author

Choose a reason for hiding this comment

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

going to change these lines to

if element_list and element_list[0]:
        children += element_list[0]['children']

Copy link
Contributor

@ivermac ivermac left a comment

Choose a reason for hiding this comment

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

Looks good to me

@DavisRayM DavisRayM merged commit f370931 into master Feb 22, 2021
@DavisRayM DavisRayM deleted the charts-endpoint-hotfix branch February 22, 2021 13:35
@DavisRayM DavisRayM mentioned this pull request Feb 23, 2021
1 task
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.

Check when field is a dict before accessing it's properties
3 participants