Skip to content

Validate tabular CSV imports against required columns#4071

Open
flomillot wants to merge 3 commits into
mainfrom
florent/csv-import-tolerate-missing-columns
Open

Validate tabular CSV imports against required columns#4071
flomillot wants to merge 3 commits into
mainfrom
florent/csv-import-tolerate-missing-columns

Conversation

@flomillot

@flomillot flomillot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Context

Since #3996 (and gridsuite/commons-ui#1166), CSV imports validated the file header with a strict equality check: the file had to contain exactly the expected columns. This dropped the previous tolerance and caused regressions — e.g. a tabular CSV without the selected-properties columns, or a limit-sets modification CSV with fewer temporary limits than declared, were rejected (both were tolerated up to v2.36.2).

Change

Use the new requiredColumns option of CsvPicker (gridsuite/commons-ui#1217) so that only the columns flagged as required by the form must be present; optional columns may be omitted and unknown columns are ignored (order irrelevant):

  • tabular creation/modification (tabular-form.tsx) — required columns derived from the field metadata; selected-properties columns are optional;
  • limit-sets tabular modification (limit-sets-tabular-modification-form.tsx) — temporary-limit columns are optional;
  • tap-changer import rule (import-rule-dialog.tsx) — every column optional.

EQUIPMENT_ID is now marked required for tabular modifications so the identifier column stays mandatory. Boolean cells are only flagged when the field is required.

Dependency

Requires gridsuite/commons-ui#1217 (requiredColumns option of CsvPicker) to be merged and released first.

Restore the pre-refactor tolerance on CSV imports: a file is accepted as long
as every column it contains is an expected one, even when it omits some columns
(unselected properties, fewer temporary limits or tap steps than the form
declares). Enable CsvPicker's allowMissingColumns on the tabular, limit-sets
and tap-changer rule imports.

Signed-off-by: Florent MILLOT <75525996+flomillot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@flomillot, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3182b607-3442-4cfd-af5a-b05373629835

📥 Commits

Reviewing files that changed from the base of the PR and between 5b7e66d and 7f6aae6.

📒 Files selected for processing (4)
  • src/components/dialogs/network-modifications/limit-sets/limit-sets-tabular-modification-form.tsx
  • src/components/dialogs/network-modifications/tabular/tabular-form.tsx
  • src/components/dialogs/network-modifications/tabular/tabular-modification-utils.ts
  • src/components/dialogs/network-modifications/two-windings-transformer/tap-changer-pane/import-rule-dialog.tsx

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Use the requiredColumns option of CsvPicker (dropping the header and
allowMissingColumns props): required columns are derived from the form
field metadata for tabular and limit-sets modifications, tap-changer
rule columns are all optional, and EQUIPMENT_ID is now required for
tabular modifications. Boolean cells are only flagged when the field is
required.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
@flomillot flomillot changed the title Tolerate CSV import files missing expected columns Validate tabular CSV imports against required columns Jun 30, 2026
Let TypeScript infer the requiredColumns memo return type instead of
annotating it explicitly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Florent MILLOT <florent.millot_externe@rte-france.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant