Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure merge tables declared in new database #1205

Merged
merged 3 commits into from
Jan 13, 2025
Merged

Ensure merge tables declared in new database #1205

merged 3 commits into from
Jan 13, 2025

Conversation

samuelbray32
Copy link
Collaborator

@samuelbray32 samuelbray32 commented Jan 3, 2025

Description

Fixes #1204, #872

  • Merge tables not guaranteed to be declared before imported by their parent_source make call
    • Can cause error in fresh database when tries to declare within the make transaction
    • Done to avoid circular imports
  • Add new util declare_all_merge_tables which imports all core spyglass merge tables to ensure declaration
  • Run during populate_all_common (part of insert_sessions) to ensure tables are declared once data is in the database

Checklist:

  • N This PR should be accompanied by a release: (yes/no/unsure)
  • NA If release, I have updated the CITATION.cff
  • N This PR makes edits to table definitions: (yes/no)
  • NA If table edits, I have included an alter snippet for release notes.
  • NA If this PR makes changes to position, I ran the relevant tests locally.
  • I have updated the CHANGELOG.md with PR number and description.
  • NA I have added/edited docs/notebooks to reflect the changes

@samuelbray32 samuelbray32 marked this pull request as ready for review January 3, 2025 17:06
Copy link
Member

@CBroz1 CBroz1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @samuelbray32!

I wondered if we should move this to part of the settings startup process, but that seems like a lot of cost to add to every session, rather than just protecting the 'populate all' startup process. I'm good with merging as-is

@@ -68,6 +68,20 @@ def ensure_names(
return getattr(table, "full_table_name", None)


def declare_all_merge_tables():
"""Ensures all merge tables in the spyglass core package are declared.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"""Ensures all merge tables in the spyglass core package are declared.
"""Ensures all merge tables in the spyglass core package are declared.

@edeno edeno merged commit 2a37bff into master Jan 13, 2025
4 checks passed
@edeno edeno deleted the 1204_fix branch January 13, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sgi.insert_sessions failing for ImportedSpikes
3 participants