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

Filter fields with null values in exported dashboard model #54126

Closed
sdboyer opened this issue Aug 24, 2022 · 4 comments
Closed

Filter fields with null values in exported dashboard model #54126

sdboyer opened this issue Aug 24, 2022 · 4 comments
Assignees
Labels
area/frontend stale Issue with no recent activity type/bug

Comments

@sdboyer
Copy link
Contributor

sdboyer commented Aug 24, 2022

One background goal with schematization is that we disallow any field, in any schematized object, from containing an explicit null value. Much ink could be spilled over this, but it is essentially because it reduces ambiguity: by banning nulls universally, we make it so that no one authoring a schema ever has to answer the question, "if a field exists with value null, is that meaningfully different from that field being absent?"

#41385 helped a lot with this by purging nulls from dashboard JSON that's sent for save. But we're still producing nulls on export, which is why PRs like #54124 end up happening - to fix something that was exported (and avoided the test that should have caught it that i only just fixed in #53797 😱).

We need to go the additional step of also stripping nulls from exported dashboard JSON.

cc @joshhunt @ryantxu

@sdboyer sdboyer added this to the 9.2.0 milestone Aug 24, 2022
@dsotirakis dsotirakis modified the milestones: 9.2.0, 9.2.0-beta1 Sep 22, 2022
@joshhunt joshhunt removed this from the 9.2.0-beta1 milestone Sep 23, 2022
@joshhunt
Copy link
Contributor

We use Infinity in the dashboard model (as a sentinel value). When browsers stringify Infinity, it converts it to null. sortedDeepCloneWithoutNulls doesn't handle this.

@sdboyer
Copy link
Contributor Author

sdboyer commented Sep 26, 2022

This feels like one case where it'd be OK to break the "no nulls in JSON" rule. That's simply because, if browsers stringify Infinity as null, then that's a) a meaningful null, because it is being used to represent a value that is not in the set of values directly representable with number, and b) doesn't require any special handling in our serialization algorithm.

That said, i am concerned about how we would account for JS having both negative and positive infinity - null can only be assumed to correspond to one of those.

Copy link
Contributor

This issue has been automatically marked as stale because it has not had activity in the last year. It will be closed in 30 days if no further activity occurs. Please feel free to leave a comment if you believe the issue is still relevant. Thank you for your contributions!

@github-actions github-actions bot added the stale Issue with no recent activity label Mar 22, 2024
Copy link
Contributor

This issue has been automatically closed because it has not had any further activity in the last 30 days. Thank you for your contributions!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend stale Issue with no recent activity type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants