Skip to content

Commit 4a9bc3d

Browse files
fix: use adapter.quote_identifier in spawn_missing_classes
The lookup_class_name call in spawn_missing_classes hardcoded MySQL backtick quoting (`db`.`tab`). On PostgreSQL, full_table_name uses double quotes ("db"."tab"), so the comparison never matched and every table was re-spawned unconditionally. Use adapter.quote_identifier() to build the full table name, consistent with the rest of schemas.py (lines 505, 606). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 34acbbe commit 4a9bc3d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/datajoint/schemas.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,16 @@ def make_classes(self, into: dict[str, Any] | None = None) -> None:
341341
frame = inspect.currentframe().f_back
342342
into = frame.f_locals
343343
del frame
344+
adapter = self.connection.adapter
344345
tables = [
345346
row[0]
346-
for row in self.connection.query(self.connection.adapter.list_tables_sql(self.database))
347-
if lookup_class_name("`{db}`.`{tab}`".format(db=self.database, tab=row[0]), into, 0) is None
347+
for row in self.connection.query(adapter.list_tables_sql(self.database))
348+
if lookup_class_name(
349+
f"{adapter.quote_identifier(self.database)}.{adapter.quote_identifier(row[0])}",
350+
into,
351+
0,
352+
)
353+
is None
348354
]
349355
master_classes = (Lookup, Manual, Imported, Computed)
350356
part_tables = []

0 commit comments

Comments
 (0)