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

Preserve schema key order when flattening a dict grouping #1701

Merged
merged 2 commits into from
Aug 6, 2021

Conversation

jonmmease
Copy link
Contributor

Small follow-on fix for flexible callback support added in #1691.

For the case of a callback that returns a dictionary grouping, this fix removes the unintentional requirement that the dictionary key order of the returned value match the key order of the dependency specification.

For example, this case now works properly:

@app.callback(dict(a=Output(...), b=Output(...)), ...)
def callback(...):
    return dict(b=0, a=1)

Copy link
Collaborator

@alexcjohnson alexcjohnson left a comment

Choose a reason for hiding this comment

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

Nice catch! And bonus points for reducing LOC (aside from tests) with the fix!
💃

@jonmmease jonmmease merged commit a19c274 into dev Aug 6, 2021
@archmoj archmoj deleted the grouped_callback_dict_ordering branch January 27, 2022 16:51
@archmoj archmoj restored the grouped_callback_dict_ordering branch January 27, 2022 16:52
@archmoj archmoj deleted the grouped_callback_dict_ordering branch January 27, 2022 16:54
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.

2 participants