bugfix for LanceTable.add to convert python lists into arrow fixed size lists

- Fixed `add` unit test to create the correct expected result
- Added a unit test for LanceTable.add
- Need to discuss if len(LanceTable) is handled correctly
This commit is contained in:
gsilvestrin
2023-04-14 14:13:01 -07:00
parent 3360678d60
commit aeecd809cc
2 changed files with 35 additions and 2 deletions

View File

@@ -171,6 +171,7 @@ def _sanitize_schema(data: pa.Table, schema: pa.Schema = None) -> pa.Table:
return data
# cast the columns to the expected types
data = data.combine_chunks()
data = _sanitize_vector_column(data, vector_column_name=VECTOR_COLUMN_NAME)
return pa.Table.from_arrays(
[data[name] for name in schema.names], schema=schema
)