0.0.630 Errata
Fixes that could change results for existing csvpaths statements
last() (#332)
true on the last physical line
true on the last scanned line with data. In a file ending with blank lines, last() and anything evaluated "at last()" see the last row with data. With an index scan running past the end (e.g. $[2+9] on a 3-line file), it fires on the last line actually scanned. With skip_blank_lines=False, blank lines are rows and the behavior is as before. completed and stopped are unchanged.
xpath() / jsonpath() as match components (#339)
matched every line, without evaluating anything
match only when the path selects something (an empty element, a JSON null, or false still counts as selected)
xpath() values (#339)
string() returned its first character; count() and boolean() returned None; an element with child elements returned None; content with an encoding declaration returned None; an empty element returned None; a path selecting several nodes returned only the first
the whole string; real numbers and booleans; all of the element's text; declarations parse; an empty element returns ""; a node-set returns one value, a list of values, or [], as jsonpath() does
pop() (#357)
returned the top item but removed the top two from the stack (one-item stacks were unaffected)
removes only the item it returns
put() (#329)
never matched, so a csvpath using it as a match component matched no lines
matches like other side effects
lt(), below(), before() (#314)
behaved as <=
strictly <
date, datetime, boolean in line() and at top level (#320)
rejected empty values, unlike the other types
accept empty values unless .notnone, like the other types
boolean() nested in or() / not() (#317)
could match invalid values
matches only real booleans
datetime comparisons (#315)
dropped the time of day
compare full datetimes
mod() (#321)
rounded to 2 decimal places
exact remainder
blank() outside line() (#349)
silently ignored in no-raise mode (no error, valid run)
reported as a language error; invalid in fail mode
A csvpath whose validation crashes (#349)
kept running a half-built expression in no-raise mode
is reported and stopped
xsd() with a missing or unreadable XSD, raise mode (#346)
raised the underlying exception, e.g. FileNotFoundError
raises MatchException, as for an invalid document
jsonschema() unexpected errors (#346)
printed a stack trace to the console
trace goes into the error and the log
Other Fixes
last():fires when no line of the file falls inside the scan range (#330);
a function wrapped in
and()insidelast()no longer runs on every line (#331);checks after a
last() -> ...when/do are no longer skipped on the last line (#325).
Language errors in no-raise mode:
xsd(),jsonschema(),roll(),line(), andyear()/month()/day()raised in every mode (a missing()ondo_i_raise). Outcomes were already right, butline()androll()skipped part of their validation in no-raise mode (#344).Named-paths groups: csvpaths no longer accumulate blank lines with every append, and a hand-edited group file no longer records padded text in the manifest (#337).
Last updated