[python] Fix a few minor bugs (#304)

This commit is contained in:
Chang She
2023-07-15 03:47:42 +08:00
committed by GitHub
parent ad18826579
commit 2fdcb307eb
5 changed files with 20 additions and 15 deletions

View File

@@ -356,18 +356,15 @@ class LanceDBConnection(DBConnection):
if mode.lower() not in ["create", "overwrite"]:
raise ValueError("mode must be either 'create' or 'overwrite'")
if data is not None:
tbl = LanceTable.create(
self,
name,
data,
schema,
mode=mode,
on_bad_vectors=on_bad_vectors,
fill_value=fill_value,
)
else:
tbl = LanceTable.open(self, name)
tbl = LanceTable.create(
self,
name,
data,
schema,
mode=mode,
on_bad_vectors=on_bad_vectors,
fill_value=fill_value,
)
return tbl
def open_table(self, name: str) -> LanceTable:

View File

@@ -18,7 +18,7 @@ from __future__ import annotations
import inspect
import sys
import types
from abc import ABC, abstractstaticmethod
from abc import ABC, abstractmethod
from typing import Any, List, Type, Union, _GenericAlias
import pyarrow as pa
@@ -27,11 +27,13 @@ from pydantic_core import CoreSchema, core_schema
class FixedSizeListMixin(ABC):
@abstractstaticmethod
@staticmethod
@abstractmethod
def dim() -> int:
raise NotImplementedError
@abstractstaticmethod
@staticmethod
@abstractmethod
def value_arrow_type() -> pa.DataType:
raise NotImplementedError

View File

@@ -226,6 +226,7 @@ class LanceQueryBuilder:
columns=self._columns,
nprobes=self._nprobes,
refine_factor=self._refine_factor,
vector_column=self._vector_column,
)
return self._table._execute_query(query)