Skip to content

feat: preserve the empty property for the three operators (&, |, ~)#3853

Merged
mattijn merged 4 commits intomainfrom
preserve-empty
Jul 16, 2025
Merged

feat: preserve the empty property for the three operators (&, |, ~)#3853
mattijn merged 4 commits intomainfrom
preserve-empty

Conversation

@mattijn
Copy link
Copy Markdown
Contributor

@mattijn mattijn commented Jul 13, 2025

Fix #3598

Can you review @joelostblom?

Video from your example in raised issue

Screen.Recording.2025-07-13.at.21.00.45.mov

Your minimal repo now returns:

import altair as alt

click = alt.selection_point("click", empty=False)
ctrl_click = alt.selection_point("ctrl_click", on="click[event.ctrlKey]", empty=True)

>>> (click & ctrl_click).to_dict()
{'and': [{'param': 'click', 'empty': False},
  {'param': 'ctrl_click', 'empty': True}]}

ctrl_click_false = alt.selection_point("ctrl_click_false", on="click[event.ctrlKey]", empty=False)

>>> (ctrl_click_false & ctrl_click).to_dict()
{'and': [{'param': 'ctrl_click_false', 'empty': False},
  {'param': 'ctrl_click', 'empty': True}]}

@joelostblom joelostblom self-requested a review July 14, 2025 13:12
Copy link
Copy Markdown
Contributor

@joelostblom joelostblom left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this! The changes look good and work as expected to me as well. The only optional improvement I can see would be to add a test, but it's not the biggest functionality fix so maybe not needed?

@mattijn mattijn enabled auto-merge (squash) July 16, 2025 05:40
@mattijn mattijn merged commit 38ed00e into main Jul 16, 2025
25 checks passed
@mattijn
Copy link
Copy Markdown
Contributor Author

mattijn commented Jul 16, 2025

Thanks @joelostblom!

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.

Parameter.empty not preserved with &, |, ~ operators

2 participants