mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-08-16 22:34:10 +02:00
transform: coerce empty strings to NULL when converting TEXT columns to numeric types (#805)
* transform: coerce empty strings to NULL when converting TEXT columns to numeric types When a TEXT column is transformed to INTEGER, FLOAT, or REAL and a row contains an empty string, the empty string is now converted to NULL during the INSERT...SELECT copy, matching the expected behavior described in #488. Fixes #488
This commit is contained in:
parent
75ba588462
commit
e4935e0644
5 changed files with 57 additions and 5 deletions
|
|
@ -25,6 +25,7 @@ Unreleased
|
|||
- ``sqlite-utils convert --dry-run`` now works for table and column names containing closing square brackets. (:issue:`829`)
|
||||
- ``table.indexes`` and ``table.xindexes`` now work for table, index and column names containing double quotes. This also fixes ``table.transform()`` for tables with those identifiers. Thanks, `nyxst4ck <https://github.com/nyxst4ck>`__. (:issue:`824`, `#825 <https://github.com/simonw/sqlite-utils/pull/825>`__)
|
||||
- Improved type annotations throughout the package and added Pyright regression checks to CI. (:issue:`833`)
|
||||
- Changing a ``TEXT`` column to ``INTEGER``, ``FLOAT`` or ``REAL`` using ``table.transform()`` or ``sqlite-utils transform`` now converts exact empty strings to ``NULL``. Previously they remained empty strings in the numeric column. Thanks, `ikatyal2110 <https://github.com/ikatyal2110>`__. (:issue:`488`, `#805 <https://github.com/simonw/sqlite-utils/pull/805>`__)
|
||||
|
||||
.. _v3_39_1:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue