mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-09-21 16:04:10 +02:00
When the input has a header but no data rows, the insert path never
creates the table - the row loop has nothing to feed into the first
insert. The post-insert tracker.transform call then asserts the table
exists and blows up:
AssertionError: Cannot transform a table that doesn't exist yet
Reported in #702 with the exact fix in the body. Guard the transform
on db[table].exists() so an empty CSV is just a no-op, matching what
--detect-types already does for a zero-byte CSV (no header either).
Closes #702.
Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| __main__.py | ||
| cli.py | ||
| db.py | ||
| hookspecs.py | ||
| plugins.py | ||
| py.typed | ||
| recipes.py | ||
| utils.py | ||