fix(python): return the session supplied to LanceDBConnection (#4433)

LanceDBConnection.session read AsyncConnection.session, but
AsyncConnection has no session attribute, so access raised
AttributeError. Store the session passed to the constructor and return
that object.

Assisted by Cursor (Grok).

Co-authored-by: Preston Zhao <195942578+canyang25@users.noreply.github.com>
This commit is contained in:
Preston Zhao
2026-10-23 02:43:36 +08:00
committed by GitHub
co-authored by Preston Zhao
parent cc9f01ae26
commit 13df747f18
3 changed files with 23 additions and 1 deletions
+3
View File
@@ -86,6 +86,7 @@ def test_sync_debugger_inspection_does_not_use_background_loop(tmp_path, monkeyp
assert members["uri"] == str(tmp_path)
assert members["read_consistency_interval"] is None
assert members["session"] is None
assert repr(db) == f"LanceDBConnection(uri={str(tmp_path)!r})"
assert repr(table) == f"LanceTable(name='test', _conn={db!r})"
@@ -105,6 +106,8 @@ def test_read_consistency_interval_does_not_use_background_loop(tmp_path, monkey
assert db.read_consistency_interval == consistency_interval
assert db_from_inner.read_consistency_interval == consistency_interval
assert db.session is None
assert db_from_inner.session is None
def test_ingest_pd(tmp_path):