fix: publish with schema - #1182
Merged
Merged
Conversation
SheetJS is only used for the binary formats. It can read CSV too, but it needs the whole file in memory, where PapaParse streams it and never converts anything, which both the announced 420 MB limit and identifiers like 01004 depend on. It is loaded dynamically so its 2.4 MB are only fetched when a binary file is dropped. Cells are read as the text the spreadsheet displays, which keeps dates and leading zeros intact, except for numbers: the General format renders anything past eleven digits as 8.69084E+12, so their raw value is used instead.
Replays datagouv/data.gouv.fr#2060 with the files it was reported with: the same washing machine record as CSV (comma and semicolon), XLSX and ODS, against the real durability, reparability and IRVE schemas. The catalog, the schema definitions and Validata are stubbed, so a test states the validation report it works against instead of discovering it, and the column counts in the assertions are measured on the fixtures. Publishing with a schema is only offered on behalf of an organization, so each test creates its own.
Searching compared raw strings, so « lave linge » missed « Lave-linge » and « reparabilite » missed « réparabilité ». Query and schema are now normalized the same way and compared word by word, and the name is searched along with the title and the description so a pasted identifier such as etalab/schema-irve-statique finds its schema. The publication wizard and the search filter share the one function.
The reload guard added to isCurrentStepValid also covered step 4, where save() empties the form right after navigating there. The watchEffect then sent the user back to step 1, making the final screen unreachable and clearing the dataset just created. The guard now stops before the last step, which only reads newDataset — the same bounding the classic wizard already applies.
A file sharing no column with the schema opened a dedicated screen instead of the editor, which cost two refs, a computed, a render branch and a nextTick round trip. The banner already says what is wrong and already offers to change the schema, so the table is now always built — only its rows are dropped, since none of their columns belongs to the schema. The threshold was also a cliff: 227 unknown columns out of 228 loaded the table, 228 switched to a blocking screen. And the case the report describes is the partial one, which never reached that screen.
Plural forms on the unknown columns message, which read '1 des 228 colonnes sont inconnues'. A punctuation-only query no longer matches the whole schema catalog. Arrow keys stop scrolling the page while moving through the listbox, which also fixes the support choices using the same composable. SchemaCard goes back to a div, since tabindex already made it focusable and a button may not hold headings and paragraphs. The active option now travels with its schema instead of being looked up again, two dead branches are gone, the error table no longer carries the DSFR bottom margin, and the wizard title comment says what is actually shared between steps: the path. Adds the two missing tests: keyboard navigation of the listbox, and the banner shown when the schema itself cannot be fetched.
udata validates a resource's schema against its own catalog (core/dataset/models.py), so publishing with a made-up name failed with a 400 and the wizard stayed on step 3. The stub now carries the real identifiers, which the fixtures already are, and the version 'latest', always accepted. Also updates two assertions left behind by the new wording of the unknown columns message.
nicolaskempf57
approved these changes
Aug 11, 2026
nicolaskempf57
left a comment
Contributor
There was a problem hiding this comment.
Do we want to also test a csv with a tab separator ?
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.
Fix datagouv/data.gouv.fr#2060