-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add nallo upload #4205
base: master
Are you sure you want to change the base?
Add nallo upload #4205
Conversation
…cs/cg into add_nallo_upload
|
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.
Looks good! There are some legacy patterns which I am not too fond of, but I do not think any of them were introduced in this PR. Please disregard the comments if you feel they are out of scope.
LOG.info( | ||
f"Upload of case {case.internal_id} was successful. Uploaded at {dt.datetime.now()} in StatusDB" | ||
) | ||
self.update_uploaded_at(analysis=analysis) |
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.
Maybe very minor but I thought this was done after uploads to Caesar? So after line 43?
self.case_tags: CaseTags = CaseTags(**NALLO_CASE_TAGS) | ||
self.sample_tags: SampleTags = SampleTags(**NALLO_SAMPLE_TAGS) |
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.
self.case_tags: CaseTags = CaseTags(**NALLO_CASE_TAGS) | |
self.sample_tags: SampleTags = SampleTags(**NALLO_SAMPLE_TAGS) | |
self.case_tags = CaseTags(**NALLO_CASE_TAGS) | |
self.sample_tags = SampleTags(**NALLO_SAMPLE_TAGS) |
hk_version_obj: Version, | ||
analysis_obj: Analysis, |
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.
Out of scope but I do not like designs where we tie the whole class to a single Version/Analysis. It makes it less flexible
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.
Also out of scope but modifying the input and making all methods return None is confusing to me. If we redesign at some point it might be nice to consider changing.
def build_load_config(self) -> NalloLoadConfig: | ||
"""Create a NALLO specific load config for uploading analysis to Scout.""" | ||
LOG.info("Build load config for NALLO case") | ||
load_config: NalloLoadConfig = NalloLoadConfig( |
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.
load_config: NalloLoadConfig = NalloLoadConfig( | |
load_config = NalloLoadConfig( |
"""Include case level files for NALLO case.""" | ||
LOG.info("Including NALLO specific case level files") | ||
for scout_key in NALLO_CASE_TAGS.keys(): | ||
self._include_case_file(load_config, scout_key) |
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.
Can we have named arguments?
"""Include the file path associated to a scout configuration parameter if the corresponding housekeeper tags | ||
are found. Otherwise return None.""" | ||
file_path = self.get_file_from_hk(getattr(self.case_tags, scout_key)) | ||
setattr(load_config, scout_key, file_path) |
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.
Named arguments
samples: list[ScoutNalloIndividual] = [] | ||
somalier_samples: str | None = None | ||
somalier_pairs: str | None = None | ||
vcf_snv: Annotated[str, BeforeValidator(field_not_none)] = 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.
I am very confused by us having a BeforeValidator seemingly avoiding "field not None" behaviour, but also us having a default value of None. Seems a bit contradictory to me.
You can consider it out of scope though, the pattern does not seem introduced by you.
Description
Added
Changed
Fixed
How to prepare for test
us
paxa
How to test
Expected test outcome
Review
Thanks for filling in who performed the code review and the test!
This version is a
Implementation Plan