Skip to content

Commit f0ac258

Browse files
fix: remove unnecessary iteration limit in load_all_downstream
The loop terminates when no new schemas are discovered. Since the total number of schemas on the server is finite, this is guaranteed to converge — even with cross-schema cycles. No safety cap needed. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent f588862 commit f0ac258

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/datajoint/dependencies.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,10 +242,7 @@ def load_all_downstream(self) -> None:
242242
self.load()
243243
return
244244

245-
# Safety limit: cross-schema FK chains are typically 3-5 deep.
246-
# Unlike the DAG within a schema, cross-schema references could
247-
# theoretically form cycles, so we cap iterations.
248-
for _ in range(50):
245+
while True:
249246
schemas_list = ", ".join(adapter.quote_string(s) for s in known_schemas)
250247
result = self._conn.query(adapter.find_downstream_schemas_sql(schemas_list))
251248
new_schemas = {row[0] for row in result} - known_schemas

0 commit comments

Comments
 (0)