-
Notifications
You must be signed in to change notification settings - Fork 70
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
[SYNPY-1575] Introduce EntityView model #1181
Conversation
…ges are made (#1176) * Support waiting for evetually consistent view after changes are made
* Pull functions out into new mixin model for table/views
@BWMac This could use a final review when you get a chance this week. Thanks in advance! |
@@ -86,7 +86,6 @@ async def testCustomConfigFile(schedule_for_cleanup): | |||
) | |||
|
|||
|
|||
@pytest.mark.flaky(reruns=3, only_rerun=["SynapseHTTPError"]) |
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.
Interesting, how have these been resolved?
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.
It has not been explicitly fixed, but a global retry mechanism was put in place after this was written.
async def test_create_entityview_with_invalid_column( | ||
self, project_model: Project | ||
) -> None: | ||
# GIVEN a entityview with an invalid column |
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 may have missed this, but what happens when an entity view is created with the default columns specified?
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.
If you are specifying a column with the same name a warning is emitted and it is overwritten with the default column:
synapsePythonClient/synapseclient/models/mixins/table_components.py
Lines 517 to 541 in 181a364
if self.include_default_columns: | |
view_type_mask = None | |
if self.view_type_mask: | |
if isinstance(self.view_type_mask, ViewTypeMask): | |
view_type_mask = self.view_type_mask.value | |
else: | |
view_type_mask = self.view_type_mask | |
default_columns = await get_default_columns( | |
view_entity_type=( | |
self.view_entity_type if self.view_entity_type else None | |
), | |
view_type_mask=view_type_mask, | |
synapse_client=synapse_client, | |
) | |
for default_column in default_columns: | |
if ( | |
default_column.name in self.columns | |
and default_column != self.columns[default_column.name] | |
): | |
client.logger.warning( | |
f"Column '{default_column.name}' already exists in dataset. " | |
"Overwriting with default column." | |
) | |
self.columns[default_column.name] = default_column |
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.
🔥 LGTM! Awesome to see this work, I'll defer to brad for final review once he's back from vacay.
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.
LGTM! 🚀
Problem:
FileView
akaEntityView
was not created in an OOP fashion.Dataset
Model & Introduces Composition Model forTable
/View
-like Classes #1175 and more generally the Table refactor: [SYNPY-1551] Tables refactor #1151Solution:
.columns
attribute to be after we get the existing object state from Synapse.Testing: