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

Closed
bmingles opened this issue Jun 13, 2024 · 0 comments · Fixed by #1026
Closed

Python - Differentiate null from undefined #549

bmingles opened this issue Jun 13, 2024 · 0 comments · Fixed by #1026
Assignees
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
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
4 participants