Skip to content

v2: handle load from external data sources #971

@samsja

Description

@samsja

Would it be possible to import from other datasources like csv or pandas dataframe in docarray v2?

Possible API:

class MyDoc(BaseDocument):
   price: float
   name: str
   date: Date
data.csv

price, name, date
1000, iphone, 2009
500, samsung, 2011
...
da = DocumentArray[MyDoc].from_csv('data.csv')

print(da[0])
>>> MyDoc(price=1000, name= iphone, date = 2011)

Question:

Can we auto detect the schema from the csv ? Is it something that we even want ?

Metadata

Metadata

Labels

DocArray v2This issue is part of the rewrite; not to be merged into main

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions