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

Ensure WidgetFilter sync_with_url uses Widget parameter to serialize values #494

Merged
merged 2 commits into from
Nov 1, 2023

Conversation

philippjfr
Copy link
Member

Since Filter.value is of type Parameter it does not define the correct serialize methods for the Location sync to correct serialize and deserialize the data values. Therefore we now sync the Widget.value rather than the Filter.value allowing the value type of the parameter to provide the correct serialization. In future Location.sync in Panel should provide a dictionary of serializers and deserializers so we can override these directly.

Fixes #455

@hoxbro
Copy link
Member

hoxbro commented Nov 1, 2023

The error you are seeing is because you are syncing twice with the widgets.

@philippjfr
Copy link
Member Author

You sure? That's what the self.widget is not None check is for.

@hoxbro
Copy link
Member

hoxbro commented Nov 1, 2023

Isn't it called once in Filter and once in each widget?

@philippjfr
Copy link
Member Author

Yes but in Filter self.widget is undefined so it's skipped.

@hoxbro
Copy link
Member

hoxbro commented Nov 1, 2023

You are right.

@philippjfr
Copy link
Member Author

The problem really is just that the widget (unlike the Filter) always has a default value, so it gets synced, even if it's an empty list.

@hoxbro hoxbro merged commit 23d1fc5 into main Nov 1, 2023
10 checks passed
@hoxbro hoxbro deleted the widget_filter_sync_url_serialization branch November 1, 2023 11:33
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabling sync_with_url for Altair Seattle Weather raises an error when setting the date
2 participants