Repository navigation
fix: quick wins from the audit (#91, #92, #93, #94) - #102
Merged
Merged
Conversation
An int or decimal value must fullmatch ASCII digits with an optional minus (and, for a decimal, a fraction and Java's exponent) before conversion, since int() and float() also take "1_0", "nan" and " 3 ", which are text from an earlier form version and now fall back with a cast_fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every form, table, dataset and column name in a join line is quoted with the helper the executed SQL uses, and an XPath string literal in a filter becomes an SQL one, so a line pastes and runs when a name holds "/", "-", "." or a reserved word. The form's schema map finds its joins by the quoted name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le (#91) An empty header, a column named twice and bytes that are not UTF-8 raise a ValueError naming the CSV wherever a dataset is read, since a row read by name keeps only the last of two columns and a bare StopIteration names nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A SCTO_SENTINELS or SCTO_DATE_SENTINELS pair whose code does not parse, or whose code is given twice, raises naming the variable and the pair, since a repeated code silently kept only the last meaning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A non-2xx response's error ends with the first 300 characters of its body, where the server says why it refused (a 417 says how long to wait); the body of an error response is the server's message, not submissions. A 2xx body that is not JSON raises naming the URL, its type and size, never its text, since a body cut short can hold submissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The [datasets.<id>] key check raises a ValueError naming the config section, since python -O strips an assert. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Docstrings and comments describe the code, not its history. Node.pulldata goes, since data_source holds the same pulldata() reading; map_column's "ambiguous" and FormContract.to_dict go, since only tests read them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> # Conflicts: # CHANGELOG.md
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.
What does this PR do? 📝
Closes #91, closes #92, closes #93, closes #94: the mechanical follow-ups from the pre-public audit.
Strict numeric parsing #94 An int or decimal column parses only the numbers the server writes: integers
-?[0-9]+, and decimals with an optional exponent (1.0E-4, which the collection app writes for very large or small values).1_0,nan,inf,3and+3stay text with acast_fallback.Runnable SQL in the DB map's join lines #92 Join lines in
<project>_db.json/_db.sqlquote every name with the existing helpers. A test runs every line against DuckDB withhh-listing/roster.csv,visit-2,hh.idandorder.Errors name the input they reject #91 Errors name the input they reject:
SCTO_SENTINELS/SCTO_DATE_SENTINELSpair;The one runtime
assertinsrc/is now aValueError.Trim the contract module #93
xml_contractdocstrings state what the code does.Node.pulldata(a duplicate ofdata_source),map_column'sambiguousandFormContract.to_dictare removed; nothing outside tests read them.How to test or reproduce ? 🧪
uv run pytest -qpasses 472 tests. Each behaviour change has a synthetic test that failed before its fix.Checklist ✅
🤖 Generated with Claude Code