Skip to content

bug(python): Table cannot be found #2727

Closed

Description

@One-sixth

LanceDB version

0.25.2

What happened?

All tables should exist. But there are some tables that were not found.

Are there known steps to reproduce?

import lancedb

db = lancedb.connect('test_db')

for n in range(20):
    db.create_table(f'table_{n}', data=[{'id': n, 'name': 'name_' + str(n)}], exist_ok=True)

for n in range(20):
    print(f'table_{n} exists', f'table_{n}' in db)

Output

table_0 exists True
table_1 exists True
table_2 exists False
table_3 exists False
table_4 exists False
table_5 exists False
table_6 exists False
table_7 exists False
table_8 exists False
table_9 exists False
table_10 exists True
table_11 exists True
table_12 exists True
table_13 exists True
table_14 exists True
table_15 exists True
table_16 exists True
table_17 exists True
table_18 exists False
table_19 exists False

Activity

  1. added
    bug
    on Oct 17, 2025
  2. wjones127 commented on Oct 17, 2025

    @wjones127
    Contributor

    Interesting bug. The tables do exist.

    I think it's sort of an accident that in db even works. I think the problem is that db.__len__() just dispatches to table_names(), which has a default limit of 10:

    def __len__(self) -> int:
    return len(self.table_names())

    @override
    def table_names(
    self,
    page_token: Optional[str] = None,
    limit: int = 10,
    *,
    namespace: List[str] = [],
    ) -> Iterable[str]:
    """Get the names of all tables in the database. The names are sorted.

    This works fine if you increase the limit parameter:

    table_names = db.table_names(limit=100)
    for n in range(20):
        print(f'table_{n} exists', f'table_{n}' in table_names)
  3. added a commit that references this issue on May 20, 2026
    15bd821
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions