fix import attr to use import attrs (#510)

Thanks to #508, I used `attr` instead of the correct package `attrs`

s/attr/attrs
This commit is contained in:
Rob Meng
2023-09-23 00:30:56 -04:00
committed by GitHub
parent bc8670d7af
commit a695fb8030
3 changed files with 10 additions and 10 deletions

View File

@@ -14,7 +14,7 @@
import abc
from typing import List, Optional
import attr
import attrs
import pyarrow as pa
from pydantic import BaseModel
@@ -44,7 +44,7 @@ class VectorQuery(BaseModel):
refine_factor: Optional[int] = None
@attr.define
@attrs.define
class VectorQueryResult:
# for now the response is directly seralized into a pandas dataframe
tbl: pa.Table

View File

@@ -16,7 +16,7 @@ import functools
from typing import Any, Callable, Dict, Optional, Union
import aiohttp
import attr
import attrs
import pyarrow as pa
from pydantic import BaseModel
@@ -43,14 +43,14 @@ async def _read_ipc(resp: aiohttp.ClientResponse) -> pa.Table:
return reader.read_all()
@attr.define(slots=False)
@attrs.define(slots=False)
class RestfulLanceDBClient:
db_name: str
region: str
api_key: Credential
host_override: Optional[str] = attr.field(default=None)
host_override: Optional[str] = attrs.field(default=None)
closed: bool = attr.field(default=False, init=False)
closed: bool = attrs.field(default=False, init=False)
@functools.cached_property
def session(self) -> aiohttp.ClientSession:

View File

@@ -11,7 +11,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import attr
import attrs
import numpy as np
import pandas as pd
import pyarrow as pa
@@ -21,10 +21,10 @@ from aiohttp import web
from lancedb.remote.client import RestfulLanceDBClient, VectorQuery
@attr.define
@attrs.define
class MockLanceDBServer:
runner: web.AppRunner = attr.field(init=False)
site: web.TCPSite = attr.field(init=False)
runner: web.AppRunner = attrs.field(init=False)
site: web.TCPSite = attrs.field(init=False)
async def query_handler(self, request: web.Request) -> web.Response:
table_name = request.match_info["table_name"]