-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
Let's assume we have a simple csv file with a boolean field:
x
false
true
If we try to read this cvs file, and then recreate the chain with to_iter
/read_records
, we encounter with an error:
import datachain as dc
chain = dc.read_csv('sample.csv')
records = [
{k: item[i] for i, k in enumerate(chain.schema.keys())}
for item in chain.to_iter()
]
dc.read_records(records, schema=chain.schema)
Error while validating/converting type for column x with value 0, original error Value 0 with type <class 'int'> incompatible for column type Boolean
This happens due to to_iter
returns int
despite bool
in the schema, but read_records
requires strict type matching. So, I think it would be more convenient if to_iter
returned bool
or read_records
could parse int
.
shcheklein
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request