mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-09 05:12:58 +00:00
add LanceModel to docs (#386)
Co-authored-by: Chang She <chang@lancedb.com>
This commit is contained in:
@@ -275,10 +275,16 @@ class LanceModel(pydantic.BaseModel):
|
||||
|
||||
@classmethod
|
||||
def to_arrow_schema(cls):
|
||||
"""
|
||||
Get the Arrow Schema for this model.
|
||||
"""
|
||||
return pydantic_to_schema(cls)
|
||||
|
||||
@classmethod
|
||||
def field_names(cls) -> List[str]:
|
||||
"""
|
||||
Get the field names of this model.
|
||||
"""
|
||||
if PYDANTIC_VERSION.major < 2:
|
||||
return list(cls.__fields__.keys())
|
||||
return list(cls.model_fields.keys())
|
||||
|
||||
Reference in New Issue
Block a user