thoth-dbmanager 0.4.6__py3-none-any.whl → 0.4.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,7 +98,12 @@ class LshManager:
98
98
  """
99
99
  try:
100
100
  if not self.storage_strategy.exists(self.lsh_base_path):
101
- logging.warning(f"LSH files not found at {self.lsh_base_path}")
101
+ # Show the actual file paths being checked for better debugging
102
+ lsh_file = self.lsh_base_path.with_suffix('.pkl')
103
+ minhashes_file = self.lsh_base_path.parent / f"{self.lsh_base_path.stem}_minhashes.pkl"
104
+ logging.warning(f"LSH files not found. Expected files:")
105
+ logging.warning(f" LSH file: {lsh_file}")
106
+ logging.warning(f" Minhashes file: {minhashes_file}")
102
107
  return False
103
108
 
104
109
  lsh_data, minhashes_data = self.storage_strategy.load(self.lsh_base_path)
@@ -92,5 +92,19 @@ class PickleStorage(LshStorageStrategy):
92
92
  """Check if both LSH and minhashes pickle files exist."""
93
93
  lsh_path = base_path.with_suffix('.pkl')
94
94
  minhashes_path = base_path.parent / f"{base_path.stem}_minhashes.pkl"
95
-
96
- return lsh_path.exists() and minhashes_path.exists()
95
+
96
+ # Add debug logging to help diagnose path issues
97
+ import logging
98
+ logger = logging.getLogger(__name__)
99
+ logger.debug(f"Checking LSH files existence:")
100
+ logger.debug(f" Base path: {base_path}")
101
+ logger.debug(f" LSH path: {lsh_path} (exists: {lsh_path.exists()})")
102
+ logger.debug(f" Minhashes path: {minhashes_path} (exists: {minhashes_path.exists()})")
103
+
104
+ lsh_exists = lsh_path.exists()
105
+ minhashes_exists = minhashes_path.exists()
106
+
107
+ if not lsh_exists or not minhashes_exists:
108
+ logger.warning(f"LSH files missing - LSH: {lsh_path} (exists: {lsh_exists}), Minhashes: {minhashes_path} (exists: {minhashes_exists})")
109
+
110
+ return lsh_exists and minhashes_exists
@@ -377,30 +377,7 @@ class MariaDBPlugin(DbPlugin):
377
377
  """Lazy load LSH manager for backward compatibility."""
378
378
  if self._lsh_manager is None and self.db_directory_path:
379
379
  from ..lsh.manager import LshManager
380
- # Try multiple possible paths for LSH data
381
- possible_paths = [
382
- self.db_directory_path, # Original path
383
- Path(self.db_root_path) / "data" / f"{self.db_mode}_databases" / self.db_id, # Data subdirectory
384
- ]
385
-
386
- lsh_manager = None
387
- for path in possible_paths:
388
- try:
389
- temp_manager = LshManager(path)
390
- if temp_manager.is_available():
391
- lsh_manager = temp_manager
392
- logger.info(f"Found LSH data at: {path}")
393
- break
394
- except Exception as e:
395
- logger.debug(f"LSH not found at {path}: {e}")
396
- continue
397
-
398
- if lsh_manager is None:
399
- # Create manager with original path as fallback
400
- lsh_manager = LshManager(self.db_directory_path)
401
- logger.warning(f"No LSH data found, using default path: {self.db_directory_path}")
402
-
403
- self._lsh_manager = lsh_manager
380
+ self._lsh_manager = LshManager(self.db_directory_path)
404
381
  return self._lsh_manager
405
382
 
406
383
  # LSH integration methods for backward compatibility
@@ -349,30 +349,7 @@ class MySQLPlugin(DbPlugin):
349
349
  """Lazy load LSH manager for backward compatibility."""
350
350
  if self._lsh_manager is None and self.db_directory_path:
351
351
  from ..lsh.manager import LshManager
352
- # Try multiple possible paths for LSH data
353
- possible_paths = [
354
- self.db_directory_path, # Original path
355
- Path(self.db_root_path) / "data" / f"{self.db_mode}_databases" / self.db_id, # Data subdirectory
356
- ]
357
-
358
- lsh_manager = None
359
- for path in possible_paths:
360
- try:
361
- temp_manager = LshManager(path)
362
- if temp_manager.is_available():
363
- lsh_manager = temp_manager
364
- logger.info(f"Found LSH data at: {path}")
365
- break
366
- except Exception as e:
367
- logger.debug(f"LSH not found at {path}: {e}")
368
- continue
369
-
370
- if lsh_manager is None:
371
- # Create manager with original path as fallback
372
- lsh_manager = LshManager(self.db_directory_path)
373
- logger.warning(f"No LSH data found, using default path: {self.db_directory_path}")
374
-
375
- self._lsh_manager = lsh_manager
352
+ self._lsh_manager = LshManager(self.db_directory_path)
376
353
  return self._lsh_manager
377
354
 
378
355
  # LSH integration methods for backward compatibility
@@ -93,30 +93,7 @@ class PostgreSQLPlugin(DbPlugin):
93
93
  """Lazy load LSH manager for backward compatibility"""
94
94
  if self._lsh_manager is None and self.db_directory_path:
95
95
  from ..lsh.manager import LshManager
96
- # Try multiple possible paths for LSH data
97
- possible_paths = [
98
- self.db_directory_path, # Original path
99
- Path(self.db_root_path) / "data" / f"{self.db_mode}_databases" / self.db_id, # Data subdirectory
100
- ]
101
-
102
- lsh_manager = None
103
- for path in possible_paths:
104
- try:
105
- temp_manager = LshManager(path)
106
- if temp_manager.is_available():
107
- lsh_manager = temp_manager
108
- logger.info(f"Found LSH data at: {path}")
109
- break
110
- except Exception as e:
111
- logger.debug(f"LSH not found at {path}: {e}")
112
- continue
113
-
114
- if lsh_manager is None:
115
- # Create manager with original path as fallback
116
- lsh_manager = LshManager(self.db_directory_path)
117
- logger.warning(f"No LSH data found, using default path: {self.db_directory_path}")
118
-
119
- self._lsh_manager = lsh_manager
96
+ self._lsh_manager = LshManager(self.db_directory_path)
120
97
  return self._lsh_manager
121
98
 
122
99
  # LSH integration methods for backward compatibility
@@ -117,30 +117,7 @@ class SQLitePlugin(DbPlugin):
117
117
  """Lazy load LSH manager for backward compatibility"""
118
118
  if self._lsh_manager is None and self.db_directory_path:
119
119
  from ..lsh.manager import LshManager
120
- # Try multiple possible paths for LSH data
121
- possible_paths = [
122
- self.db_directory_path, # Original path
123
- Path(self.db_root_path) / "data" / f"{self.db_mode}_databases" / self.db_id, # Data subdirectory
124
- ]
125
-
126
- lsh_manager = None
127
- for path in possible_paths:
128
- try:
129
- temp_manager = LshManager(path)
130
- if temp_manager.is_available():
131
- lsh_manager = temp_manager
132
- logger.info(f"Found LSH data at: {path}")
133
- break
134
- except Exception as e:
135
- logger.debug(f"LSH not found at {path}: {e}")
136
- continue
137
-
138
- if lsh_manager is None:
139
- # Create manager with original path as fallback
140
- lsh_manager = LshManager(self.db_directory_path)
141
- logger.warning(f"No LSH data found, using default path: {self.db_directory_path}")
142
-
143
- self._lsh_manager = lsh_manager
120
+ self._lsh_manager = LshManager(self.db_directory_path)
144
121
  return self._lsh_manager
145
122
 
146
123
  # LSH integration methods for backward compatibility
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thoth_dbmanager
3
- Version: 0.4.6
3
+ Version: 0.4.8
4
4
  Summary: A Python library for managing SQL databases with support for multiple database types, LSH-based similarity search, and a modern plugin architecture.
5
5
  Author-email: Marco Pancotti <mp@tylconsulting.it>
6
6
  Project-URL: Homepage, https://github.com/mptyl/thoth_dbmanager
@@ -22,18 +22,18 @@ thoth_dbmanager/helpers/search.py,sha256=k04L7clSPfeQOlq_ifsH3PZ21ZK-rujh_Qy4hWr
22
22
  thoth_dbmanager/lsh/__init__.py,sha256=zAUTRuRX4MNc2nU93tTBkT2_IVL7OBkBL0WZPPgO3Ec,555
23
23
  thoth_dbmanager/lsh/core.py,sha256=171FqHW7ItAqAPk6g_AoayKTE3Bs1rRZxnt55MJVzjY,6813
24
24
  thoth_dbmanager/lsh/factory.py,sha256=2Bpkk-OygjaptZAw1yysxO1cxG3QTxmJ1yFGcXHqX3w,2411
25
- thoth_dbmanager/lsh/manager.py,sha256=NDKU2re6Xp7cU6pB5EtucZqQgPiT5nyugoUCCIAG29s,5777
26
- thoth_dbmanager/lsh/storage.py,sha256=Wp1fjVBVE3inRFTAZCxlc6vwZdlKDwY7wCfwfu7P5Xw,3085
25
+ thoth_dbmanager/lsh/manager.py,sha256=tdTY4X3Hu7gOFd-iNCT410Fg-wIZ-XdzBu5YzZ9nehA,6150
26
+ thoth_dbmanager/lsh/storage.py,sha256=9n-2qoHaqJ87SnZtKY58dUFhGDIIXGj5ydkKTX-rWfk,3759
27
27
  thoth_dbmanager/plugins/__init__.py,sha256=98iKwNiKnFFeJfw0qLGVOrP2Mo2wGPAolsx7R2B3emA,592
28
- thoth_dbmanager/plugins/mariadb.py,sha256=-tXnYs-5zbx60LPGE95JwCblWu18PrPJXmChXEaZ9uo,18967
29
- thoth_dbmanager/plugins/mysql.py,sha256=D15RgPbM59tgrcIxyx26V2_efWWuD1Pm62MB6xcGCAo,17538
28
+ thoth_dbmanager/plugins/mariadb.py,sha256=ElYa4Rexwrofcjcs0UQKan8fZpbU6-n9zghYR9SgRb4,17975
29
+ thoth_dbmanager/plugins/mysql.py,sha256=mbDsIDV2H_BWYANU4JHMsUkxLQICuGtjKTTPbig2Ngs,16546
30
30
  thoth_dbmanager/plugins/oracle.py,sha256=k4Yxvz5MdsH3Sfty9lxbhr8igSnHvGbGujz3bLpNcHo,5230
31
- thoth_dbmanager/plugins/postgresql.py,sha256=xtBWBzEnyDQsGSq2bgI-ID6acpnchOLf0XxcBnRz5bw,6510
32
- thoth_dbmanager/plugins/sqlite.py,sha256=loWJwir8Sczt5r7PVY2KFNNfGkIGB8SkJ9hdHJOllTM,7496
31
+ thoth_dbmanager/plugins/postgresql.py,sha256=pI1W9oHpQty8tHMoEDcsOT-Msv6S4aoFcArOGFxLR7Q,5518
32
+ thoth_dbmanager/plugins/sqlite.py,sha256=iMlOH4XMEY-Ac3yrs1HzjKaR4km1DxLDwAEjGZzM0Cc,6504
33
33
  thoth_dbmanager/plugins/sqlserver.py,sha256=mMb3F5FmSWV02FZwj-Ult-2TjuyeVA4Fl1iME1dbgLU,5289
34
34
  thoth_dbmanager/plugins/supabase.py,sha256=mWlaGAdpywx4-pU4Ffpmn24ze8sg0sM5kc6bFDoeYRg,8645
35
- thoth_dbmanager-0.4.6.dist-info/licenses/LICENSE,sha256=81-BOzGgwtY1XdYfkwMQB87AkOGXI9OMq0kjNcZA4UE,1071
36
- thoth_dbmanager-0.4.6.dist-info/METADATA,sha256=ErCKl7Y7e_lTcn6EngCacl_HNarVAD7Ww2hujsJHcXQ,12246
37
- thoth_dbmanager-0.4.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
- thoth_dbmanager-0.4.6.dist-info/top_level.txt,sha256=b9ttxm9RUc0KUCASEKRx6FqoREYJ1-KZWSpNuaM0uQ4,16
39
- thoth_dbmanager-0.4.6.dist-info/RECORD,,
35
+ thoth_dbmanager-0.4.8.dist-info/licenses/LICENSE,sha256=81-BOzGgwtY1XdYfkwMQB87AkOGXI9OMq0kjNcZA4UE,1071
36
+ thoth_dbmanager-0.4.8.dist-info/METADATA,sha256=3KNrltdL1_d6l1Jd8Y4WBYgIUCESLgfx_5f3PGqgbnc,12246
37
+ thoth_dbmanager-0.4.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
38
+ thoth_dbmanager-0.4.8.dist-info/top_level.txt,sha256=b9ttxm9RUc0KUCASEKRx6FqoREYJ1-KZWSpNuaM0uQ4,16
39
+ thoth_dbmanager-0.4.8.dist-info/RECORD,,