mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
Fix for np.int8 error, refs #632
Also refs: - https://github.com/simonw/llm/issues/531
This commit is contained in:
parent
577078fe01
commit
dc79454234
1 changed files with 19 additions and 15 deletions
|
|
@ -206,21 +206,25 @@ COLUMN_TYPE_MAPPING = {
|
|||
}
|
||||
# If numpy is available, add more types
|
||||
if np:
|
||||
COLUMN_TYPE_MAPPING.update(
|
||||
{
|
||||
np.int8: "INTEGER",
|
||||
np.int16: "INTEGER",
|
||||
np.int32: "INTEGER",
|
||||
np.int64: "INTEGER",
|
||||
np.uint8: "INTEGER",
|
||||
np.uint16: "INTEGER",
|
||||
np.uint32: "INTEGER",
|
||||
np.uint64: "INTEGER",
|
||||
np.float16: "FLOAT",
|
||||
np.float32: "FLOAT",
|
||||
np.float64: "FLOAT",
|
||||
}
|
||||
)
|
||||
try:
|
||||
COLUMN_TYPE_MAPPING.update(
|
||||
{
|
||||
np.int8: "INTEGER",
|
||||
np.int16: "INTEGER",
|
||||
np.int32: "INTEGER",
|
||||
np.int64: "INTEGER",
|
||||
np.uint8: "INTEGER",
|
||||
np.uint16: "INTEGER",
|
||||
np.uint32: "INTEGER",
|
||||
np.uint64: "INTEGER",
|
||||
np.float16: "FLOAT",
|
||||
np.float32: "FLOAT",
|
||||
np.float64: "FLOAT",
|
||||
}
|
||||
)
|
||||
except AttributeError:
|
||||
# https://github.com/simonw/sqlite-utils/issues/632
|
||||
pass
|
||||
|
||||
# If pandas is available, add more types
|
||||
if pd:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue