From 984add4894274bbf9e66e21ac4796db0171f758b Mon Sep 17 00:00:00 2001 From: Jacobi Petrucciani Date: Thu, 29 Aug 2019 17:04:34 -0400 Subject: [PATCH] fixing some typing issues --- qoo/queues.py | 10 +++++----- setup.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qoo/queues.py b/qoo/queues.py index 2dd6a9d..e97f3ce 100644 --- a/qoo/queues.py +++ b/qoo/queues.py @@ -41,9 +41,9 @@ def __contains__(self, key: str) -> bool: """check if the given key exists in this job""" return key in dir(self) - def __eq__(self, other: "Job") -> bool: + def __eq__(self, other: object) -> bool: """check if this Job is equal to another""" - return self._handle == other._handle + return isinstance(other, Job) and self._handle == other._handle def __str__(self) -> str: """return a human-friendly object representation""" @@ -165,7 +165,7 @@ def send_batch( raw_jobs: List[Union[Dict, str]], delay_seconds: int = 0, auto_metadata: bool = True, - ) -> List[Dict]: + ) -> Dict: """ send a batch of jobs to the queue, chunked into 10s @@ -174,8 +174,8 @@ def send_batch( a list of dicts to json.dumps into message bodies """ jobs = raw_jobs - successful = [] - failed = [] + successful = [] # type: List + failed = [] # type: List # if default, treat each list item as just the message body if auto_metadata: diff --git a/setup.py b/setup.py index 70b952b..22be16e 100755 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="qoo", - version="0.0.3", + version="0.0.4", description=("A simple library for interacting with Amazon SQS."), long_description=LONG_DESCRIPTION, author="Jacobi Petrucciani",