mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-03 10:22:56 +00:00
chore(python): get rid of Pydantic deprication warning in embedding fcn (#816)
``` UserWarning: Valid config keys have changed in V2: * 'keep_untouched' has been renamed to 'ignored_types' warnings.warn(message, UserWarning) ```
This commit is contained in:
committed by
Weston Pace
parent
dc0b11a86a
commit
340fd98b42
@@ -20,6 +20,7 @@ import numpy as np
|
||||
from .base import TextEmbeddingFunction
|
||||
from .registry import register
|
||||
from .utils import api_key_not_found_help, TEXT
|
||||
from lancedb.pydantic import PYDANTIC_VERSION
|
||||
|
||||
|
||||
@register("gemini-text")
|
||||
@@ -78,8 +79,10 @@ class GeminiText(TextEmbeddingFunction):
|
||||
query_task_type: str = "retrieval_query"
|
||||
source_task_type: str = "retrieval_document"
|
||||
|
||||
class Config: # Pydantic 1.x compat
|
||||
keep_untouched = (cached_property,)
|
||||
if PYDANTIC_VERSION < (2, 0): # Pydantic 1.x compat
|
||||
|
||||
class Config:
|
||||
keep_untouched = (cached_property,)
|
||||
|
||||
def ndims(self):
|
||||
# TODO: fix hardcoding
|
||||
|
||||
Reference in New Issue
Block a user