diff options
Diffstat (limited to 'uploader/jobs.py')
| -rw-r--r-- | uploader/jobs.py | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/uploader/jobs.py b/uploader/jobs.py index e86ee05..b2de54b 100644 --- a/uploader/jobs.py +++ b/uploader/jobs.py @@ -41,7 +41,8 @@ def error_filename(jobid, error_dir): "Compute the path of the file where errors will be dumped." return f"{error_dir}/job_{jobid}.error" -def initialise_job(# pylint: disable=[too-many-arguments] +def initialise_job( + # pylint: disable=[too-many-arguments, too-many-positional-arguments] rconn: Redis, rprefix: str, jobid: str, command: list, job_type: str, ttl_seconds: int = 86400, extra_meta: Optional[dict] = None) -> dict: "Initialise a job 'object' and put in on redis" @@ -54,7 +55,8 @@ def initialise_job(# pylint: disable=[too-many-arguments] name=job_key(rprefix, jobid), time=timedelta(seconds=ttl_seconds)) return the_job -def build_file_verification_job(#pylint: disable=[too-many-arguments] +def build_file_verification_job( + #pylint: disable=[too-many-arguments, too-many-positional-arguments] redis_conn: Redis, dburi: str, redisuri: str, @@ -77,7 +79,8 @@ def build_file_verification_job(#pylint: disable=[too-many-arguments] "filename": os.path.basename(filepath), "percent": 0 }) -def data_insertion_job(# pylint: disable=[too-many-arguments] +def data_insertion_job( + # pylint: disable=[too-many-arguments, too-many-positional-arguments] redis_conn: Redis, filepath: str, filetype: str, totallines: int, speciesid: int, platformid: int, datasetid: int, databaseuri: str, redisuri: str, ttl_seconds: int) -> dict: @@ -144,8 +147,8 @@ def job_errors( return take( ( json.loads(error) - for key in rconn.keys(f"{prefix}:{str(job_id)}:*:errors:*") - for error in rconn.lrange(key, 0, -1)), + for key in rconn.keys(f"{prefix}:{str(job_id)}:*:errors:*")# type: ignore[union-attr] + for error in rconn.lrange(key, 0, -1)),# type: ignore[union-attr] count) @@ -157,8 +160,8 @@ def job_files_metadata( """Get the metadata for specific job file.""" return { key.split(":")[-1]: { - **rconn.hgetall(key), + **rconn.hgetall(key),# type: ignore[dict-item] "filetype": key.split(":")[-3] } - for key in rconn.keys(f"{prefix}:{str(job_id)}:*:metadata*") + for key in rconn.keys(f"{prefix}:{str(job_id)}:*:metadata*")# type: ignore[union-attr] } |
