-
Notifications
You must be signed in to change notification settings - Fork 2
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
Expose 'submission_date' and 'update_date' (#2562, #3310) #3026
Expose 'submission_date' and 'update_date' (#2562, #3310) #3026
Conversation
f802ed7
to
d8c6459
Compare
Codecov Report
@@ Coverage Diff @@
## develop #3026 +/- ##
===========================================
+ Coverage 82.36% 82.50% +0.13%
===========================================
Files 123 123
Lines 13998 14035 +37
===========================================
+ Hits 11529 11579 +50
+ Misses 2469 2456 -13
Continue to review full report at Codecov.
|
d8c6459
to
e374041
Compare
e374041
to
3cf1af4
Compare
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.
So far so good. Could you spend two hours investigating what it would entail to have these two properties exposed for every inner entity? This would allow us to expose not only when the project itself was updated but also entities that contribute to it. I think this would imply that we need to aggregate over the properties, I think using min
for submission_date and max
for update_date
.
adef2d9
to
2e8b35f
Compare
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.
Whenever you copy and paste the same code multiple times, an alarm bell needs to go off.
elif field == 'update_date': | ||
return MaxAccumulator() | ||
else: | ||
return SetAccumulator(max_size=10) |
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.
Why 10 and not 100?
elif field == 'submission_date': | ||
return MinAccumulator() | ||
elif field == 'update_date': | ||
return MaxAccumulator() | ||
else: | ||
return SetAccumulator(max_size=100) |
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 is all painfully duplicative. We should adjust the default implementation so we can write
elif field == 'submission_date': | |
return MinAccumulator() | |
elif field == 'update_date': | |
return MaxAccumulator() | |
else: | |
return SetAccumulator(max_size=100) | |
else: | |
return super()._get_accumulator() |
without affecting the semantics.
else: | ||
return None |
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 is different to the other implementations of this method. We should create a new _get_default_accumulator() method in the base class and override that here to return None
instead of SetAccumulator(max_size=100)
.
'document_id': str(cell_line.document_id), | ||
'biomaterial_id': cell_line.biomaterial_id, |
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.
'document_id': str(cell_line.document_id), | |
'biomaterial_id': cell_line.biomaterial_id, | |
**_biomaterial(cell_line), |
_biomaterial calls _entity and adds and adds an entry for biomaterial_id
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.
Similar structure for the _foo_types
methods.
'submission_date': cell_line.submission_date, | ||
'update_date': cell_line.update_date, |
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.
'submission_date': cell_line.submission_date, | |
'update_date': cell_line.update_date, |
@@ -782,74 +815,96 @@ def _related_file(self, file: api.File) -> MutableJSON: | |||
'uuid': file.manifest_entry.uuid, | |||
'drs_path': self.bundle.drs_path(file.manifest_entry.json), | |||
'version': file.manifest_entry.version, | |||
'submission_date': file.submission_date, | |||
'update_date': file.update_date, | |||
} | |||
|
|||
@classmethod | |||
def _analysis_protocol_types(cls) -> FieldTypes: | |||
return { | |||
'document_id': null_str, |
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.
'document_id': null_str, | |
**_entity(file), |
'submission_date': null_str, | ||
'update_date': null_str, |
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.
'submission_date': null_str, | |
'update_date': null_str, |
src/azul/service/hca_response_v5.py
Outdated
'submissionDate': p['submission_date'], | ||
'updateDate': p['update_date'], |
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.
Same refactoring here.
7a3a01a
to
d6f5901
Compare
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.
Commit title Add "Assert Messaging" to Contributing document
is bad. Neither the section name nor the file name matches.
This PR is connected to #3310 but there is no commit referencing that issue. The ticket references in commit titles are EXTREMELY important because when done right, the commit shows up in the ticket which is INVALUABLE when trying to make sense of things later.
I think we may want to commit the workaround for the Python bug as a separate commit.
CONTRIBUTING.rst
Outdated
@@ -478,6 +478,38 @@ Static methods | |||
higher order concerns than the one about whether a method's body currently | |||
references self or not. | |||
|
|||
Error Messages |
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.
Error Messages | |
Error messages |
CONTRIBUTING.rst
Outdated
Error Messages | ||
---------------- |
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.
Error Messages | |
---------------- | |
Error Messages | |
-------------- |
d408410
to
6a8498d
Compare
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 renamed one of the tickets. Could you update the commit title accordingly?
No bump.
6a8498d
to
99785e5
Compare
99785e5
to
54f948d
Compare
@danielsotirhos the PR title only referenced on of the commits addressed here. I've updated it, but this is how I messed up the merge commit on develop |
Failures on
There were no unexpected failures. |
#2562
#3310
Author
Author (reindex)
r
tag to commit title or this PR does not require reindexingreindex
label to PR or this PR does not require reindexingAuthor (freebies & chains)
chain
label to the blocking PR or this PR is not chained to another PRAuthor (upgrading)
u
tag to commit title or this PR does not require upgradingupgrade
label to PR or this PR does not require upgradingAuthor (requirements, before every review)
make requirements_update
or this PR leaves requirements*.txt, common.mk and Makefile untouchedR
tag to commit title or this PR leaves requirements*.txt untouchedreqs
label to PR or this PR leaves requirements*.txt untouchedAuthor (before every review)
make integration_test
passes in personal deployment or this PR does not touch functionality that could break the ITdevelop
, squashed old fixupsPrimary reviewer (after approval)
no demo
no sandbox
Operator (before pushing merge the commit)
reindex
label andr
commit title tagno demo
no sandbox
sandbox
label or PR is labeledno sandbox
sandbox
or this PR does not require reindexingsandbox
sandbox
or this PR does not require reindexingsandbox
Operator (after pushing the merge commit)
N reviews
labelling is accurateOperator (reindex)
dev
or this PR does not require reindexing or does not targetdev
dev
or this PR does not require reindexing or does not targetdev
prod
or this PR does not require reindexing or does not targetprod
prod
or this PR does not require reindexing or does not targetprod
Operator