Fix multiple_datasets validation in plot config wizard#643
Draft
SimonHeybrock wants to merge 1 commit intomainfrom
Draft
Fix multiple_datasets validation in plot config wizard#643SimonHeybrock wants to merge 1 commit intomainfrom
SimonHeybrock wants to merge 1 commit intomainfrom
Conversation
The `multiple_datasets` field in `DataRequirements` was not being validated when configuring plots through the wizard. In the new flow (output schema -> select plotter -> select source -> plot), the plotter selection used a single-entry template dict, so `multiple_datasets=False` plotters always passed validation. Users could then select multiple sources in step 3, which would fail at runtime. Fix by: - Add `allow_multiple_sources` property to `ConfigurationAdapter` (default True) - Override in `PlotConfigurationAdapter` to return `data_requirements.multiple_datasets` - Update `ConfigurationWidget` to show `Select` dropdown (single) vs `MultiChoice` (multiple) based on this property This prevents invalid configurations at the UI level rather than failing at runtime. Prompt: class DataRequirements has a multiple_datasets field, which used to be used to validate a data selection in an old approach where we had "actual dataset -> select plotter -> configure plotter -> plot". Since, we have refactored to select plotters based on a schema "output schema -> select plotter -> select source and configure plotter -> lazily-created-plot (once data arrives)". I am thus wondering where the multiple_datasets option is somehow dead code (and thus a bug, since it fails to be validated)? Or does it get used when the plot config modal validates the source name selection? 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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.
NOT READY FOR REVIEW
Summary
multiple_datasets=Falseplotters could be configured with multiple sourcesallow_multiple_sourcesproperty toConfigurationAdapter(derived fromDataRequirements.multiple_datasets)Problem
The
multiple_datasetsfield inDataRequirementswas not being validated when configuring plots through the wizard. In the new flow (output schema → select plotter → select source → plot), plotter selection used a single-entry template dict, somultiple_datasets=Falseplotters always passed validation. Users could then select multiple sources in the configuration step, which would fail at runtime.Solution
Prevent invalid configurations at the UI level by showing:
allow_multiple_sources=Falseallow_multiple_sources=TrueTest plan
🤖 Generated with Claude Code