Skip to content

Commit

Permalink
Changes following PR review @edeno
Browse files Browse the repository at this point in the history
  • Loading branch information
CBroz1 committed Feb 9, 2024
1 parent 37be01b commit 002df04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/spyglass/common/common_usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class InsertError(dj.Manual):
---
dj_user: varchar(64)
connection_id: int # MySQL CONNECTION_ID()
nwb_file_name: varchar(64)
table: varchar(64)
error_type: varchar(64)
error_message: varchar(255)
Expand Down
7 changes: 5 additions & 2 deletions src/spyglass/common/populate_all_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def populate_all_common(nwb_file_name):
error_constants = dict(
dj_user=dj.config["database.user"],
connection_id=dj.conn().connection_id,
nwb_file_name=nwb_file_name,
)

for table in tables:
Expand All @@ -62,8 +63,10 @@ def populate_all_common(nwb_file_name):
)
query = InsertError & error_constants
if query:
err_tables = query.fetch("table")
logger.error(
f"Errors occurred during population:\n{query}\n"
+ "See common_useage.InsertError for more details"
f"Errors occurred during population for {nwb_file_name}:\n\t"
+ f"Failed tables {err_tables}\n\t"
+ "See common_usage.InsertError for more details"
)
return query.fetch("KEY")

0 comments on commit 002df04

Please sign in to comment.