Skip to content

Commit 3e32188

Browse files
committed
Simplify ExternalTable storage initialization
Remove lazy initialization pattern for storage attribute since it was being initialized in __init__ anyway. Storage is now a regular instance attribute instead of a property.
1 parent 5170ab1 commit 3e32188

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/datajoint/external.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class ExternalTable(Table):
3939
def __init__(self, connection, store, database):
4040
self.store = store
4141
self.spec = config.get_store_spec(store)
42-
self._storage = None
4342
self.database = database
4443
self._connection = connection
4544
self._heading = Heading(
@@ -54,7 +53,7 @@ def __init__(self, connection, store, database):
5453
if not self.is_declared:
5554
self.declare()
5655
# Initialize storage backend (validates configuration)
57-
_ = self.storage
56+
self.storage = StorageBackend(self.spec)
5857

5958
@property
6059
def definition(self):
@@ -73,13 +72,6 @@ def definition(self):
7372
def table_name(self):
7473
return f"{EXTERNAL_TABLE_ROOT}_{self.store}"
7574

76-
@property
77-
def storage(self) -> StorageBackend:
78-
"""Get or create the storage backend instance."""
79-
if self._storage is None:
80-
self._storage = StorageBackend(self.spec)
81-
return self._storage
82-
8375
@property
8476
def s3(self):
8577
"""Deprecated: Use storage property instead."""

0 commit comments

Comments
 (0)