-
Notifications
You must be signed in to change notification settings - Fork 72
[SYNPY-1578] DatasetCollection
OOP Model
#1189
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
Conversation
@BWMac I merged in the changes to develop. This branch is ready for your resolution to the merge conflicts |
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.
Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (2)
tests/unit/synapseclient/models/synchronous/unit_test_dataset.py:121
- [nitpick] Consider using a less brittle error message matcher (for example, checking for a substring like 'Dataset or EntityRef') to reduce test fragility if the error message formatting changes.
with pytest.raises(ValueError, match="item must be a Dataset or EntityRef. 1 is a <class 'int'>",):
synapseclient/api/entity_factory.py:383
- [nitpick] It might help to add an inline comment clarifying that entity_to_update is reused when provided, which is particularly relevant now that the mapping includes DatasetCollection.
entity_instance = entity_to_update or entity_class()
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 left my last round of comments, great changes here. Thanks for your attention to detail on the changes.
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.
🔥 nice! i took a look at the tests and thanks for tackling this!
Problem:
We do not currently have an OOP model representing the Synapse
DatasetCollection
model. We should follow the example of theDataset
class and use the table component mixins to create one.Solution:
This PR follows the
Dataset
example to create theDatasetCollection
model. Users are now able to:DatasetCollection
s in SynapseDatasetCollection
sDatasetCollection
sDataset
s to their collectionDataset
s from their collectionDataset
s within a collection using custom columnsDatasetCollection
sNeeded documentation pages and a tutorial to help users get started using
DatasetCollection
s were added to the mkdocs site.Testing:
DatasetCollection
classNotes:
_cast_into_class_type
function inentity_factory.py
was getting pretty unwieldy with the amountif
/elif
lines that were included, but a lot of logic was repeated across many different concrete types. I refactored that function to reduce complexity and hopefully make it more maintainable. I will need to addMaterializedView
to this new mapping method and resolve conflicts once [SYNPY-1579] Introduce the materialized view #1190 is merged.