diff options
author | Frederick Muriuki Muriithi | 2024-10-17 11:31:59 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-10-17 11:32:27 -0500 |
commit | 9db2d0986619bf801e2308ee55e4340d9f050376 (patch) | |
tree | 246afb4ccbf12b45c28e1c2ca49211ec36db8a16 /uploader | |
parent | b8299e6c7cdb0819883bfd8e142fc71c43440746 (diff) | |
download | gn-uploader-9db2d0986619bf801e2308ee55e4340d9f050376.tar.gz |
mypy: Fix some typing issues.
Diffstat (limited to 'uploader')
-rw-r--r-- | uploader/input_validation.py | 2 | ||||
-rw-r--r-- | uploader/phenotypes/views.py | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/uploader/input_validation.py b/uploader/input_validation.py index 3b5d4dd..627c69e 100644 --- a/uploader/input_validation.py +++ b/uploader/input_validation.py @@ -55,7 +55,7 @@ def is_valid_representative_name(repr_name: str) -> bool: return bool(pattern.match(repr_name)) -def encode_errors(errors: tuple[tuple[str, str], ...], form) -> str: +def encode_errors(errors: tuple[tuple[str, str], ...], form) -> bytes: """Encode form errors into base64 string.""" return base64.b64encode( json.dumps({ diff --git a/uploader/phenotypes/views.py b/uploader/phenotypes/views.py index eb0b460..5f6e4a6 100644 --- a/uploader/phenotypes/views.py +++ b/uploader/phenotypes/views.py @@ -259,7 +259,7 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable= request.args.get("error_values", ""))) form = request.form - _errors = tuple() + _errors: tuple[tuple[str, str], ...] = tuple() if not is_valid_representative_name( (form.get("dataset-name") or "").strip()): _errors = _errors + (("dataset-name", "Invalid dataset name."),) @@ -297,7 +297,7 @@ def create_dataset(species: dict, population: dict, **kwargs):# pylint: disable= species_redirect_uri="species.populations.phenotypes.index", population_redirect_uri="species.populations.phenotypes.select_population", redirect_uri="species.populations.phenotypes.list_datasets") -def add_phenotypes(species: dict, population: dict, dataset: dict, **kwargs): +def add_phenotypes(species: dict, population: dict, dataset: dict, **kwargs):# pylint: disable=[unused-argument, too-many-locals] """Add one or more phenotypes to the dataset.""" with (database_connection(app.config["SQL_URI"]) as conn, conn.cursor(cursorclass=DictCursor) as cursor): |