mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-14 15:52:57 +00:00
fix
This commit is contained in:
@@ -36,19 +36,20 @@ from typing import (
|
||||
import numpy as np
|
||||
import pyarrow as pa
|
||||
import pydantic
|
||||
import semver
|
||||
from lance.arrow import (
|
||||
EncodedImageType,
|
||||
)
|
||||
from pydantic.fields import FieldInfo
|
||||
from pydantic_core import core_schema
|
||||
|
||||
PYDANTIC_VERSION = semver.Version.parse(pydantic.__version__)
|
||||
|
||||
if TYPE_CHECKING:
|
||||
import semver
|
||||
from pydantic.fields import FieldInfo
|
||||
|
||||
from .embeddings import EmbeddingFunctionConfig
|
||||
|
||||
PYDANTIC_VERSION = semver.Version.parse(pydantic.__version__)
|
||||
try:
|
||||
from pydantic import GetJsonSchemaHandler
|
||||
from pydantic.json_schema import JsonSchemaValue
|
||||
|
||||
@@ -23,7 +23,6 @@ from typing import List, Optional, Tuple
|
||||
import pyarrow as pa
|
||||
import pydantic
|
||||
import pytest
|
||||
from lance.arrow import EncodedImageType
|
||||
from pydantic import Field
|
||||
|
||||
from lancedb.pydantic import (
|
||||
@@ -263,10 +262,6 @@ def test_schema_with_images():
|
||||
class TestModel(LanceModel):
|
||||
img: EncodedImage()
|
||||
|
||||
schema = pa.schema([pa.field("img", EncodedImageType(), False)])
|
||||
assert schema == TestModel.to_arrow_schema()
|
||||
assert TestModel.field_names() == ["img"]
|
||||
|
||||
img_path = Path(os.path.dirname(__file__)) / "images/1.png"
|
||||
with open(img_path, "rb") as f:
|
||||
img_bytes = f.read()
|
||||
|
||||
Reference in New Issue
Block a user