Skip to content

Commit

Permalink
Init table in join
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Oct 30, 2024
1 parent 49254ec commit d3a0c51
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/spyglass/utils/mixins/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from re import match as re_match

from datajoint.condition import make_condition
from datajoint.table import Table
from packaging.version import parse as version_parse

from spyglass.utils.logging import logger
Expand Down Expand Up @@ -264,6 +265,8 @@ def _run_join(self, **kwargs):

joined = self.proj().join(other.proj(), log_export=False)
for table in table_list: # log separate for unique pks
if isinstance(table, type) and issubclass(table, Table):
table = table() # adapted from dj.declare.compile_foreign_key
for r in joined.fetch(*table.primary_key, as_dict=True):
table._log_fetch(restriction=r)

Expand Down

0 comments on commit d3a0c51

Please sign in to comment.