-
Notifications
You must be signed in to change notification settings - Fork 41
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
Periph table fallback on TableChain for experimenter summary #1035
Conversation
@MichaelCoulter did this solution work for you? |
Was trying to test with data, but ran into issues from legacy tables in our database (#976) |
I'll see if I can find a systematic way to get rid of the empty legacy tables |
Thanks @CBroz1, as a note, the blocking ones I was hitting had small (~1 entries) likely used in development, but not definitively named as such |
@CBroz1 , wanted to know if you think this is a reasonable feature to include in this PR: I found a way to load all spyglass shared schemas such that their nodes are in the dependency graph. import datajoint as dj
from spyglass.utils.database_settings import SHARED_MODULES
def load_spyglass_shared_schemas():
# Get a list of all shared schemas in spyglass
keys = dj.conn().query(
"""
SELECT
concat('`', table_schema, '`.`', table_name, '`') as tab, column_name
FROM information_schema.key_column_usage
WHERE table_name not LIKE "~%%" AND constraint_name="PRIMARY"
"""
)
shared_schema = []
for key in keys:
schema_name = key[0].split(".")[0].strip("`")
schema_prefix = schema_name.split("_")[0]
if schema_prefix in SHARED_MODULES and schema_name not in shared_schema:
shared_schema.append(schema_name)
# Load the dependencies for all shared schemas
for s in shared_schema:
dj.schema(s).connection.dependencies.load()
return shared_schema
load_spyglass_shared_schemas()
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could include comment above, otherwise looks and runs fine
Description
Thanks, @MichaelCoulter for submitting #1031
Previously, the
SpyglassMixin
delete process inherited banning of peripheral tables behavior, which is useful in the case of long-distance restrictions, and failed to fully inherit ignoring of non-spyglass tables. This cropped up for both (a) delete permission via the session table, and (b) downstream descendants for deleting part-masters.I address this by giving
TableChain
a new fallback for the path between two nodes that includes peripheral tables, if no connection was previously found. This allows tables likeIntervalLinearizedPosition
to find a session connection, and ignores custom tables when checking downstream for part-master deletes.Checklist:
CITATION.cff
alter
snippet for release notes.CHANGELOG.md
with PR number and description.