Skip to content

Commit 6cf7627

Browse files
committed
safety on table name
1 parent 3caf4cb commit 6cf7627

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/spyglass/common/populate_all_common.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import List, Union
22

33
import datajoint as dj
4+
from datajoint.utils import to_camel_case
45

56
from spyglass.common.common_behav import (
67
PositionSource,
@@ -80,10 +81,11 @@ def single_transaction_make(
8081
for parent in parents[1:]:
8182
key_source *= parent.proj()
8283

83-
if table.__name__ == "PositionSource":
84+
table_name = to_camel_case(table.table_name)
85+
if table_name == "PositionSource":
8486
# PositionSource only uses nwb_file_name - full calls redundant
8587
key_source = dj.U("nwb_file_name") & key_source
86-
if table.__name__ == "ImportedPose":
88+
if table_name == "ImportedPose":
8789
key_source = Nwbfile()
8890

8991
for pop_key in (key_source & file_restr).fetch("KEY"):

0 commit comments

Comments
 (0)