scripts: csv.py: Tweaked expr-less -F to still typecheck
I was expecting -ba -Fa to sort numerically, but it was not. Turns out hidden field fields (-F/--hidden-field) without exprs were never typechecked. This is not an issue for non-hidden field fields (-f/--field), because we typecheck these explicitly in compile.
This commit is contained in:
+3
-1
@@ -2619,7 +2619,9 @@ def main(csv_paths, *,
|
|||||||
if v is not None]
|
if v is not None]
|
||||||
exprs = [(k, v)
|
exprs = [(k, v)
|
||||||
for k, v in it.chain(
|
for k, v in it.chain(
|
||||||
((k, v) for (k, v), hidden in (fields or [])),
|
# expr-less fields at least imply typechecking
|
||||||
|
((k, v) if v is not None else (k, CsvExpr(k))
|
||||||
|
for (k, v), hidden in (fields or [])),
|
||||||
((k, v) for (k, v), reverse in (sort or [])),
|
((k, v) for (k, v), reverse in (sort or [])),
|
||||||
((k, v) for (k, v), reverse in (hot or [])))
|
((k, v) for (k, v), reverse in (hot or [])))
|
||||||
if v is not None]
|
if v is not None]
|
||||||
|
|||||||
Reference in New Issue
Block a user