From 50c30c5d34dab481ca00897ed9fb63aa8b033567 Mon Sep 17 00:00:00 2001 From: Lei Xu Date: Mon, 30 Dec 2024 18:54:31 -0800 Subject: [PATCH] chore(python): fix typo of the synchronized checkout API (#1988) --- python/python/lancedb/_lancedb.pyi | 2 +- python/python/lancedb/remote/table.py | 16 +++------------- python/python/lancedb/table.py | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/python/python/lancedb/_lancedb.pyi b/python/python/lancedb/_lancedb.pyi index 3d87d0cf..617bdddf 100644 --- a/python/python/lancedb/_lancedb.pyi +++ b/python/python/lancedb/_lancedb.pyi @@ -37,7 +37,7 @@ class Table: async def count_rows(self, filter: Optional[str]) -> int: ... async def create_index(self, column: str, config, replace: Optional[bool]): ... async def version(self) -> int: ... - async def checkout(self, version): ... + async def checkout(self, version: int): ... async def checkout_latest(self): ... async def restore(self): ... async def list_indices(self) -> List[IndexConfig]: ... diff --git a/python/python/lancedb/remote/table.py b/python/python/lancedb/remote/table.py index 71d4b6be..d3caeb5f 100644 --- a/python/python/lancedb/remote/table.py +++ b/python/python/lancedb/remote/table.py @@ -1,15 +1,5 @@ -# Copyright 2023 LanceDB Developers -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: Copyright The LanceDB Authors from datetime import timedelta import logging @@ -91,7 +81,7 @@ class RemoteTable(Table): """to_pandas() is not yet supported on LanceDB cloud.""" return NotImplementedError("to_pandas() is not yet supported on LanceDB cloud.") - def checkout(self, version): + def checkout(self, version: int): return LOOP.run(self._table.checkout(version)) def checkout_latest(self): diff --git a/python/python/lancedb/table.py b/python/python/lancedb/table.py index fe1c7588..0ef77d54 100644 --- a/python/python/lancedb/table.py +++ b/python/python/lancedb/table.py @@ -1092,7 +1092,7 @@ class Table(ABC): """ @abstractmethod - def checkout(self): + def checkout(self, version: int): """ Checks out a specific version of the Table @@ -3049,7 +3049,7 @@ class AsyncTable: return versions - async def checkout(self, version): + async def checkout(self, version: int): """ Checks out a specific version of the Table