diff options
| author | Frederick Muriuki Muriithi | 2025-12-19 12:53:20 -0600 |
|---|---|---|
| committer | Frederick Muriuki Muriithi | 2025-12-19 12:53:20 -0600 |
| commit | 56ed0f57b816b1023a97b7205268deed0a45c77e (patch) | |
| tree | 29bad7b0b2ff78230d80b5c5ec76eb2822b8d84b /uploader/phenotypes/models.py | |
| parent | d04b7cb89b3fbaa1689f8f6525a2740eda7c3be3 (diff) | |
| download | gn-uploader-56ed0f57b816b1023a97b7205268deed0a45c77e.tar.gz | |
Fix issues caught by type-checker.
Diffstat (limited to 'uploader/phenotypes/models.py')
| -rw-r--r-- | uploader/phenotypes/models.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/uploader/phenotypes/models.py b/uploader/phenotypes/models.py index e962e62..7c051d7 100644 --- a/uploader/phenotypes/models.py +++ b/uploader/phenotypes/models.py @@ -255,9 +255,9 @@ def phenotypes_vector_data(# pylint: disable=[too-many-arguments, too-many-posit xref_ids: tuple[int, ...] = tuple(), offset: int = 0, limit: Optional[int] = None -) -> dict[tuple[int, int, int]: dict[str, Union[int,float]]]: +) -> dict[tuple[int, int, int], dict[str, Union[int,float]]]: """Retrieve the vector data values for traits in the database.""" - _params = (species_id, population_id) + _params: tuple[int, ...] = (species_id, population_id) _query = ("SELECT " "Species.Id AS SpeciesId, iset.Id AS InbredSetId, " "pxr.Id AS xref_id, pdata.*, Strain.Id AS StrainId, " @@ -381,7 +381,7 @@ def create_new_phenotypes(# pylint: disable=[too-many-locals] phenotypes: Iterable[dict] ) -> tuple[dict, ...]: """Add entirely new phenotypes to the database. WARNING: Not thread-safe.""" - _phenos = tuple() + _phenos: tuple[dict, ...] = tuple() with conn.cursor(cursorclass=DictCursor) as cursor: def make_next_id(idcol, table): cursor.execute(f"SELECT MAX({idcol}) AS last_id FROM {table}") @@ -430,9 +430,10 @@ def create_new_phenotypes(# pylint: disable=[too-many-locals] if len(batch) == 0: break - params, abbrevs = reduce(__build_params_and_prepubabbrevs__, - batch, - (tuple(), tuple())) + params, abbrevs = reduce(#type: ignore[var-annotated] + __build_params_and_prepubabbrevs__, + batch, + (tuple(), tuple())) # Check for uniqueness for all "Pre_publication_description" values abbrevs_paramsstr = ", ".join(["%s"] * len(abbrevs)) _query = ("SELECT PublishXRef.PhenotypeId, Phenotype.* " |
