Enhance task column cardinality with type groups - #859
Merged
Conversation
A task stated its column contract as one list of allowed types plus one
cardinality for the whole side. That cannot express "one date column and
any number of numeric ones": a single total accepts two dates and no
numbers just as readily.
Tasks now declare a list of groups, each naming interchangeable types and
how many columns of that set it takes, the way BaseGenerativeTask states
its per type counts. Cardinality may be an exact int, "n", or a
{min, max} range. The older two key spelling is read as a single group,
so existing tasks and plugins are unchanged, and get_metadata reports
both views so every current consumer keeps reading what it read before.
The column picker banner renders one requirement line per group.
cristian-tamblay
approved these changes
Sep 7, 2026
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.
Summary
A task stated its column contract as one list of allowed types plus one cardinality for the whole side. That cannot express "one date column and any number of numeric ones": a single total accepts two dates and no numbers just as readily as the intended shape.
Tasks now declare a list of groups, each naming a set of interchangeable types and how many columns of that set it takes, the way
BaseGenerativeTaskalready states its per type counts. Cardinality may be an exact int,"n", or a{min, max}range whosemaxmay itself be"n".The older two key spelling (
inputs_types+inputs_cardinality) is read as the single group it always meant, so every existing task and plugin is unchanged.get_metadatareports both views, so every current consumer keeps reading exactly what it read before.Type of Change
Check all that apply like this [x]:
Changes (by file)
DashAI/back/tasks/base_task.py: added_column_groups,_bounds,_total_cardinality,_type_name,_cardinality_textand_validate_side.get_metadatanow emitsinputs/outputs(the per group form) alongside the four flat keys.validate_dataset_for_taskdelegates to the per side check, which charges each column to the first group that accepts its type and still has room, then checks every group against its own bounds. Error messages name the group's types only when there is more than one group, so single group tasks produce the message they always did.DashAI/front/src/components/models/modelSession/PrepareDatasetStep.jsx: addedcolumnGroupsOf(readsmetadata.inputs/outputs, falling back to the flat pair) anddescribeCardinality. The requirements banner renders one line per group instead of one line per side.DashAI/front/src/types/task.ts: addedITaskColumnGroupand the optionalinputs/outputsfields onITaskMetadataParameters.DashAI/front/src/utils/i18n/locales/{en,es,pt,de,zh}/experiments.json: addedlabel.cardinalityAtLeastandlabel.cardinalityBetween.tests/back/tasks/test_task_column_groups.py: new. Covers group assignment, a group under its minimum, a group over its maximum, a type in no group, the error naming the short group, the metadata reporting both views, and the older contract still validating the way it did.tests/back/tasks/test_tasks.py: metadata assertions updated from 4 keys to 6, with the group shape asserted.tests/back/api/test_components_api.py: expected task metadata in the API responses gained theinputs/outputskeys.Testing