Skip to content

Commit

Permalink
Try-catch in case the ._client attribute is not present (#13681)
Browse files Browse the repository at this point in the history
* Try-catch in case the ._client attribute is not present

* lint

* vbump

---------

Co-authored-by: Andrei Fajardo <andrei@nerdai.io>
  • Loading branch information
joshkyh and nerdai committed May 24, 2024
1 parent 24f9117 commit 2acb473
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,10 @@ def __init__(

def __del__(self) -> None:
"""Close the client when the object is deleted."""
if self._client is not None:
try: # try-catch in case the attribute is not present
self._client.disconnect()
except AttributeError:
pass

@property
def client(self) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exclude = ["**/BUILD"]
license = "MIT"
name = "llama-index-vector-stores-supabase"
readme = "README.md"
version = "0.1.4"
version = "0.1.5"

[tool.poetry.dependencies]
python = ">=3.8.1,<4.0"
Expand Down

0 comments on commit 2acb473

Please sign in to comment.