File tree 1 file changed +1
-7
lines changed
1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change 21
21
import re
22
22
import sys
23
23
import warnings
24
- import weakref
25
24
from typing import Any , Optional
26
25
27
26
from hopsworks_common import client , usage , util , version
@@ -352,7 +351,6 @@ def connect(self) -> None:
352
351
"""
353
352
client .stop ()
354
353
self ._connected = True
355
- finalizer = weakref .finalize (self , self .close )
356
354
try :
357
355
# determine engine, needed to init client
358
356
if (self ._engine is not None and self ._engine .lower () == "spark" ) or (
@@ -415,7 +413,6 @@ def connect(self) -> None:
415
413
self ._provide_project ()
416
414
except (TypeError , ConnectionError ):
417
415
self ._connected = False
418
- finalizer .detach ()
419
416
raise
420
417
421
418
self ._check_compatibility ()
@@ -449,7 +446,7 @@ def close(self) -> None:
449
446
This will clean up any materialized certificates on the local file system of
450
447
external environments such as AWS SageMaker.
451
448
452
- Usage is optional.
449
+ Usage is recommended but optional.
453
450
454
451
!!! example
455
452
```python
@@ -458,9 +455,6 @@ def close(self) -> None:
458
455
conn.close()
459
456
```
460
457
"""
461
- if not self ._connected :
462
- return # the connection is already closed
463
-
464
458
from hsfs import engine
465
459
466
460
if OpenSearchClientSingleton ._instance :
You can’t perform that action at this time.
0 commit comments