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

Python - Differentiate null from undefined #549

Open
bmingles opened this issue Jun 13, 2024 · 0 comments
Open

Python - Differentiate null from undefined #549

bmingles opened this issue Jun 13, 2024 · 0 comments
Labels
enhancement New feature or request Python Involves Python side of a plugin
Milestone

Comments

@bmingles
Copy link
Contributor

In dh ui, we currently serialize Python dictionaries dropping None values

This is fine in many cases, but there are others where we need to differentiate null vs undefined values (e.g. selected_key in Picker and ComboBox components).

A way we could address this:

  • Create a sentinel value to represent UNDEFINED
  • Use the sentinel value as the default for all of our prop signature (e.g. selected_key=UNDEFINED)
  • In dict_to_camel_case drop UNDEFINED values but keep None values as null
@bmingles bmingles added enhancement New feature or request triage Python Involves Python side of a plugin labels Jun 13, 2024
@vbabich vbabich added this to the Backlog milestone Jun 18, 2024
@vbabich vbabich removed the triage label Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Python Involves Python side of a plugin
Projects
None yet
Development

No branches or pull requests

2 participants