-
Notifications
You must be signed in to change notification settings - Fork 45
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
Expand Export logging abilities #1164
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
First pass review, will update after testing
Just a general comment from testing. I found in my code several cases where I logged large sections of tables for export due to restriction calls. ex) Would it make sense to have an environment variable such as Edit: |
If I understand correctly, we would have one flag for turning on logging, and another for turning on logging of restrictions? The latter sound like a different way of achieving Maybe a prompt? MyTable & my_restr1 & my_restr2
>> Warning. This logged >1k entries. Proceed? [Yes/No]
>> You may want to change this to Table & dj.AndList([r1, r2]) Ideally, we could find a way around this |
if log_export and self.export_id: | ||
self._log_fetch(restriction=merge_restriction) |
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.
I don't think this is necessary here now. The Merge table is logged for export by the restriction call self & {self._reserved_sk: source} & merge_restriction
below.
This also logs extra entries when fetch_nwb
is called by passing a restriction for the parent source table. In that case, merge_restriction = True
and the entire merge table gets logged.
Thanks for your review @samuelbray32. I incorporated your feedback. Let me know if you think the new join handling will work Unfortunately, I did not see consistent hitting of
So this will still bear the |
Thanks Chris! At the end of the day, it may just require users adding some manual calls to their tables in their export process to ensure things get hit. For example, fetches or restrictions after a table join won't get logged anyways since it is now happening on a |
Just noticed while running in docker that the external table Proposal: |
Follow up on the external tables: Here is a way to select just the entries in the external table we want in the export from spyglass.common.common_nwbfile import schema as common_schema
location="analysis"
filepaths = (Export * Export.File() & paper_key).fetch("file_path")
external_key = []
for path in filepaths:
if not location in path:
continue
external_key.append({"filepath": path.split(location)[1][1:]})
external = common_schema.external['analysis']
external & external_key We would need to do this for |
Co-authored-by: Samuel Bray <[email protected]>
That's right! It looks like datajoint's |
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.
Thanks @CBroz1!
Description
This PR addresses #1144 by
SpyglassMixin
andMerge
I made the decision to add a
mixin
folder with the future intent of breaking upSpyglassMixin
into more manageable pieces.This PR also makes changes to
Merge.delete
to avoid issues with attemptingPart.delete
with the newforce_masters
flag. I remove this flag and run a delete of orphaned master table entriesChecklist:
CITATION.cff
alter
snippet for release notes.CHANGELOG.md
with PR number and description.