-
Notifications
You must be signed in to change notification settings - Fork 12
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
DM-23024: Allow multiple datasets to be associated with a single file on ingest #218
Merged
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
f41850c
Add basic ingest test
timj 9c2bfcb
Add support for ingesting multiple datasets from a single file
timj 283f753
Change iterable to not iterate Mappings
timj 17e54a1
Fix a deprecation warning coming from afw changes
timj c4c01f0
Fix multi-dataset ingest
timj 82c95e8
Only remove datasets from datastore if it is the last ref to it
timj 6ffc9ca
Improve ingest tests to check for removal and URI
timj 8629cab
Fix stringification of DatasetRef with non-none id
timj be69ac2
Refactor code for checking if last ref to a file is being removed
timj 94a591c
Check for dataset existence before removing it
timj cdcc81d
Add Datastore.names property to get all the datastore names
timj ac8010d
We are returning ids so call them ids and not refs
timj 9271800
Take datastore names into account before removing components
timj File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
summary: | ||
AM1: 5.2 | ||
AMS: 30.6 | ||
output: | ||
a: | ||
- 1 | ||
- 2 | ||
- 3 | ||
b: | ||
blue: 5 | ||
red: green | ||
data: | ||
- 563 | ||
- 234 | ||
- 456.7 | ||
- 752 | ||
- 8 | ||
- 9 | ||
- 27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
summary: | ||
AM1: 15.2 | ||
AMS: 130.6 | ||
output: | ||
a: | ||
- -1 | ||
- -2 | ||
- -3 | ||
b: | ||
blue: 10 | ||
red: red | ||
data: | ||
- 1563 | ||
- 1234 | ||
- 1456.7 | ||
- 1752 | ||
- 18 | ||
- 19 | ||
- 127 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
detector1: | ||
summary: | ||
AM1: 5.2 | ||
AMS: 30.6 | ||
output: | ||
a: | ||
- 1 | ||
- 2 | ||
- 3 | ||
b: | ||
blue: 5 | ||
red: green | ||
data: | ||
- 563 | ||
- 234 | ||
- 456.7 | ||
- 752 | ||
- 8 | ||
- 9 | ||
- 27 | ||
detector2: | ||
summary: | ||
AM1: 15.2 | ||
AMS: 130.6 | ||
output: | ||
a: | ||
- -1 | ||
- -2 | ||
- -3 | ||
b: | ||
blue: 10 | ||
red: red | ||
data: | ||
- 1563 | ||
- 1234 | ||
- 1456.7 | ||
- 1752 | ||
- 18 | ||
- 19 | ||
- 127 |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This makes me a little nervous, as I think it's hard to remember what makes a class qualify as a
Mapping
. Could we at least make this not the default behavior? Or maybe allow generalisinstance
exceptions via an optional kwarg, i.e.:iterable(x, except=collections.abc.Mapping)
(though that's not terribly readable either).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.
Do you ever want iterable to return the keys of a Mapping? The problem here is dataIds and compatbility with old YAML files.
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.
That's a fair point; I think you're right that this is the only behavior we'd ever actually want for mappings - my concern is more that it's not the behavior I would have naively expected. But it's not a big deal either way.
I do think Python mappings would be much cleaner if they weren't iterable at all and you had to explicitly say
keys()
, but of course there's nothing we can do about that.