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 ordered dictionary bug. #2936

Closed
wants to merge 1 commit into from

Conversation

SalehHindi
Copy link

The add slice page fails to load because it tries to execute ordered(datasources) where datasources is a list of dictionaries. This PR fixes that bug and also adds to some tests that I wrote earlier that should have caught the page failing to load. My bad!

@ascott, this is the PR for the error I mentioned here.

@mistercrunch mistercrunch requested a review from ascott June 9, 2017 16:38
@mistercrunch
Copy link
Member

@ascott I'm wondering how it worked in your environment

@ascott
Copy link

ascott commented Jun 9, 2017

@mistercrunch i am wondering the same thing. i tested locally and staging/prod and everything worked as expected.

@SalehHindi can you share the error that you are seeing?

@ascott
Copy link

ascott commented Jun 9, 2017

maybe sorted sorts on a label key by default?

screenshot 2017-06-09 12 21 28

screenshot 2017-06-09 12 22 10

@ascott
Copy link

ascott commented Jun 9, 2017

i opened a new PR to sort explicitly on the label key, and fixed the test name to be more clear.
#2939
@mistercrunch @SalehHindi

@SalehHindi
Copy link
Author

SalehHindi commented Jun 10, 2017

So I just retested this and it looks like the add slice page works on python 2.7 but not 3.5. However, once you add key=lambda d: d["label"] as an argument to sorted like you did in your PR it does work on python 3.5.

For reference, this is the error I was seeing.

I'm going to close this PR because @ascott's solution is more concise than mine.

@SalehHindi SalehHindi closed this Jun 10, 2017
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.

3 participants