fix: default input-select select_type to 'from-options'#407
Draft
sLightlyDev wants to merge 1 commit into
Draft
Conversation
Contributor
📝 WalkthroughWalkthroughThis PR fixes a serialization bug in select input metadata where null or undefined Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
New Input Select blocks were created with deepnote_variable_select_type set to null. The @deepnote/blocks serializer validates this field against a strict 'from-options' | 'from-variable' enum and rejects null, which made freshly-added Input Select blocks impossible to save. Default the field to 'from-options' so new blocks serialize cleanly, and add regression tests covering the default value and idempotent round-tripping of the cell value (guarding against repeated JSON escaping).
3a007f5 to
ea0346f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
New Input Select blocks were created with
deepnote_variable_select_typeset tonull. The@deepnote/blocksserializer validates this field against a strict'from-options' | 'from-variable'enum and rejectsnull, so freshly-added Input Select blocks could not be saved.Fix
Default
deepnote_variable_select_typeto'from-options'inDeepnoteSelectInputMetadataSchemaso new blocks serialize cleanly.Tests
Added regression tests in
inputConverters.unit.test.ts:select_typeto a valid enum value (notnull).JSON.stringifyescaping growing the cell value.Full unit suite green (2333 passing).
CI note
The required Build & Test check is red, but the tests pass (
2333 passingin the job log). The failure is in the later "Upload test results to Codecov" step:This is a Codecov CLI / infrastructure issue unrelated to this change — it currently fails the same step on other open PRs as well. No action needed in this PR to address it.