From 8ae4f42fbe69f7e3bf7de513d1dde28b685d8ffb Mon Sep 17 00:00:00 2001 From: Prashanth Rao <35005448+prrao87@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:55:07 -0500 Subject: [PATCH] fix: add to_lance() and to_polars() stub methods for type-checkers (#2876) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds `Table.to_lance()` and `Table.to_polars()` methods (non-abstract methods, defaulting to `NotImplementedError`) so type checkers like mypy, pyright and ty don’t flag them as unknown attributes on `Table`. Not making these abstract methods should keep existing remote/other `Table` implementations instantiable. This is non-breaking change to existing functionality and is purely for the purpose of pleasing static type-checkers like mypy, ty and pyright. image --- python/python/lancedb/table.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/python/python/lancedb/table.py b/python/python/lancedb/table.py index 96c6a13a..72451d2b 100644 --- a/python/python/lancedb/table.py +++ b/python/python/lancedb/table.py @@ -684,6 +684,24 @@ class Table(ABC): """ raise NotImplementedError + def to_lance(self, **kwargs) -> lance.LanceDataset: + """Return the table as a lance.LanceDataset. + + Returns + ------- + lance.LanceDataset + """ + raise NotImplementedError + + def to_polars(self, **kwargs) -> "pl.DataFrame": + """Return the table as a polars.DataFrame. + + Returns + ------- + polars.DataFrame + """ + raise NotImplementedError + def create_index( self, metric="l2",