mirror of
https://github.com/lancedb/lancedb.git
synced 2026-03-31 21:10:41 +00:00
fix: change _client reference to _conn (#3188)
This code previously referenced `self._client`, which does not exist. This change makes it correctly call `self._conn.close()`
This commit is contained in:
@@ -568,4 +568,4 @@ class RemoteDBConnection(DBConnection):
|
||||
|
||||
async def close(self):
|
||||
"""Close the connection to the database."""
|
||||
self._client.close()
|
||||
self._conn.close()
|
||||
|
||||
@@ -1201,6 +1201,18 @@ async def test_header_provider_overrides_static_headers():
|
||||
await db.table_names()
|
||||
|
||||
|
||||
def test_close():
|
||||
"""Test that close() works without AttributeError."""
|
||||
import asyncio
|
||||
|
||||
def handler(req):
|
||||
req.send_response(200)
|
||||
req.end_headers()
|
||||
|
||||
with mock_lancedb_connection(handler) as db:
|
||||
asyncio.run(db.close())
|
||||
|
||||
|
||||
@pytest.mark.parametrize("exception", [KeyboardInterrupt, SystemExit, GeneratorExit])
|
||||
def test_background_loop_cancellation(exception):
|
||||
"""Test that BackgroundEventLoop.run() cancels the future on interrupt."""
|
||||
|
||||
Reference in New Issue
Block a user