A robot telemetry CSV import can parse successfully while one record has too many fields and another has too few. Converting each row to a dictionary does not automatically enforce the table's column-count contract. A receiver that reads only the expected keys can quietly ignore extra values or treat an automatically filled value as though the sender supplied it.
This article proposes a structural check before interpreting telemetry values. An original in-memory fixture was executed with Python 3.14.7. It contains fictional record identifiers and temperature strings, with no device connection or production import. The numbers illustrate parsing outcomes; they are not temperature limits or robot settings.
Understand the dictionary reader's accommodation
Python's csv reference documents two accommodations in DictReader. Extra fields go into a list under restkey, whose default is None. For a nonblank row with fewer fields than the header, missing fields receive restval, also None by default. These behaviors preserve a usable mapping without deciding that the row matches an application's schema.
The inspected CPython 3.14 implementation creates a dictionary from paired header names and row values, compares their lengths, then stores the extra tail or fills the missing positions. That source explains where the accommodation occurs. A successful dictionary construction is therefore a different observation from a successful width check.
Use a small telemetry contract
The synthetic file declares exactly two columns: record_id and temperature_c. Its five data records are A,21; B,22,calibration; C; D,; and E,"23,4". Each displayed semicolon separates examples in this paragraph; the fixture stores each record on its own line. The last temperature value is quoted so its internal comma remains inside one CSV field.
The application contract requires two parsed fields per data record. That is a structural rule only. Whether an identifier is allowed, a temperature is numeric, or an empty temperature is permitted belongs to later validation. Keeping those decisions separate produces a more useful explanation of a rejected record.
Replay the default result before imposing a policy
The executed default DictReader maps A to the two expected string values. For B, it maps temperature_c to the string 22 and places the extra string calibration in a list under the None key. Code that copies only record_id and temperature_c would drop that evidence from its downstream representation.
For C, the mapping contains record_id C and temperature_c equal to Python None. For D, temperature_c is the empty string. Those are different observations: C omitted the second field, while D supplied an empty second field. Replacing both immediately with a generic blank would hide the difference before the import contract could inspect it.
The reader returns the quoted value 23,4 as one string for E. That row has the correct width even though a later numeric conversion may reject the comma-containing string under its chosen number format. Counting raw commas would conflate CSV quoting with the application's numeric interpretation.
Make missing and extra positions unmistakable
The proposed fixture uses one unique object as restkey and another unique object as restval. A text header cannot equal the reserved object key, and an ordinary parsed field string cannot be the missing-value object. This preserves a clear structural distinction without choosing a visible sentinel string that a sender might legitimately supply.
After each row is parsed, check whether the reserved extra key exists and whether any expected field value is the missing object by identity. Hold rows with either condition. Under this declared policy, B fails for its extra field and C fails for its missing field. A, D, and E pass the width check only.
The executed sentinel-based reader produced those five outcomes. It also retained D's empty string and E's quoted-comma string unchanged. The proof file serializes the missing object with a descriptive marker for human review; that marker was not inserted into the input file or used as the parser's actual sentinel.
Do not read strict as a schema guarantee
The fixture enabled strict=True and still received the accommodated B and C mappings. That is an observed result on the tested runtime. A parser option with that name should not be credited with a column-count rule that the actual output did not enforce.
Validate the header separately before checking row widths. The proposed two-column contract requires the expected names in the expected order, without repeated or empty header names. Width checking alone does not establish that the header names mean what the downstream measurement code expects. This article's fixture uses a valid unique header so it can isolate the row-width behavior.
Retain evidence before value conversion
For a rejected import row, preserve the source file identity, declared dialect, parsed field count or explicit missing and extra positions, record location, and the structural decision. Do not reconstruct the original CSV by simply joining dictionary values; that can lose the distinction the receipt is intended to explain.
A logical CSV record can require interpretation through the configured quoting rules. For this small single-line fixture, the reader's line number identifies the displayed physical line. A production review should retain a record ordinal and suitable source-location evidence under its actual input format, rather than assuming every logical record occupies exactly one line.
Complete the two-stage review
After width acceptance, apply the telemetry contract's value checks to the preserved strings. In this example, D still needs an empty-value decision and E still needs a number-format decision. Passing the width check should not produce a general valid-data badge or insert the record into a calculation whose value requirements remain unresolved.
The practical result is a precise admission boundary. The reader can accommodate malformed-width records for inspection, while the application can refuse to accept them as conforming telemetry rows. Extra calibration text and an omitted temperature become explicit findings, rather than disappearing behind a successfully returned dictionary.
Sources checked November 18, 2026:
Python Software Foundation, csv.DictReader reference:
https://docs.python.org/3/library/csv.html
CPython maintainers, Python 3.14 Lib/csv.py inspected on the check date:
https://github.com/python/cpython/blob/3.14/Lib/csv.py
The file, sentinel policy, executed fixture, and telemetry review design are original T-800 editorial work. No production telemetry, device settings, or robot behavior was tested.
Illustration: an AI-generated conceptual table contrasts an extra field with a missing field under a two-column contract. It is not a screenshot of a real robot telemetry import.