Skip to content

Commit 8f6e139

Browse files
committed
Add and comply with Bugbear checks
1 parent 4d15d67 commit 8f6e139

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ strict = true
5959
include = ["src/obelisk/**/*.py"]
6060

6161
[tool.ruff.lint]
62-
select = ["E4", "E7", "E9", "F", "ASYNC", "S"]
62+
select = ["E4", "E7", "E9", "F", "ASYNC", "S", "B"]
6363
ignore = []

src/obelisk/asynchronous/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def __init__(
3535
self,
3636
client: str,
3737
secret: str,
38-
retry_strategy: RetryStrategy = NoRetryStrategy(),
38+
retry_strategy: RetryStrategy = NoRetryStrategy(), # noqa: B008 # This is fine to bew shared
3939
kind: ObeliskKind = ObeliskKind.CLASSIC,
4040
) -> None:
4141
self._client = client

src/obelisk/asynchronous/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,11 @@ async def fetch_single_chunk(
103103
except json.JSONDecodeError as e:
104104
msg = f"Obelisk response is not a JSON object: {e}"
105105
self.log.warning(msg)
106-
raise ObeliskError(msg)
106+
raise ObeliskError(msg) from e
107107
except ValidationError as e:
108108
msg = f"Response cannot be validated: {e}"
109109
self.log.warning(msg)
110-
raise ObeliskError(msg)
110+
raise ObeliskError(msg) from e
111111

112112
async def query(
113113
self,

src/obelisk/asynchronous/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ def __init__(
222222
self,
223223
client: str,
224224
secret: str,
225-
retry_strategy: RetryStrategy = NoRetryStrategy(),
225+
retry_strategy: RetryStrategy = NoRetryStrategy(), # noqa: B008 # This is fine to bew shared
226226
) -> None:
227227
BaseClient.__init__(
228228
self,
@@ -281,11 +281,11 @@ async def fetch_single_chunk(self, params: QueryParams) -> QueryResult:
281281
except json.JSONDecodeError as e:
282282
msg = f"Obelisk response is not a JSON object: {e}"
283283
self.log.warning(msg)
284-
raise ObeliskError(msg)
284+
raise ObeliskError(msg) from e
285285
except ValidationError as e:
286286
msg = f"Response cannot be validated: {e}"
287287
self.log.warning(msg)
288-
raise ObeliskError(msg)
288+
raise ObeliskError(msg) from e
289289

290290
async def query(self, params: QueryParams) -> List[Datapoint]:
291291
params.cursor = None

src/obelisk/sync/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(
3636
self,
3737
client: str,
3838
secret: str,
39-
retry_strategy: RetryStrategy = NoRetryStrategy(),
39+
retry_strategy: RetryStrategy = NoRetryStrategy(), # noqa: B008 # This is fine to bew shared
4040
kind: ObeliskKind = ObeliskKind.CLASSIC,
4141
):
4242
self.async_obelisk = AsyncObelisk(client, secret, retry_strategy, kind)

src/obelisk/types/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"""
2828

2929

30-
class Constraint(ABC):
30+
class Constraint(ABC): # noqa: B024 # This is just a marker class
3131
"""
3232
Constraints are simply groups of :class:`Comparison`,
3333
such as :class:`And`, or :class:`Or`.

0 commit comments

Comments
 (0)