diff --git a/django_prometheus/db/common.py b/django_prometheus/db/common.py index 538810c0..7f87dfca 100644 --- a/django_prometheus/db/common.py +++ b/django_prometheus/db/common.py @@ -63,16 +63,18 @@ class CursorWrapper(cursor_class): def execute(self, *args, **kwargs): execute_total.labels(alias, vendor).inc() - with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType( - errors_total, extra_labels=labels + with ( + query_duration_seconds.labels(**labels).time(), + ExceptionCounterByType(errors_total, extra_labels=labels), ): return super().execute(*args, **kwargs) def executemany(self, query, param_list, *args, **kwargs): execute_total.labels(alias, vendor).inc(len(param_list)) execute_many_total.labels(alias, vendor).inc(len(param_list)) - with query_duration_seconds.labels(**labels).time(), ExceptionCounterByType( - errors_total, extra_labels=labels + with ( + query_duration_seconds.labels(**labels).time(), + ExceptionCounterByType(errors_total, extra_labels=labels), ): return super().executemany(query, param_list, *args, **kwargs) diff --git a/pyproject.toml b/pyproject.toml index 99a2ecbe..5667b631 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,8 +7,7 @@ addopts = " --ignore django_prometheus/tests/end2end" [tool.ruff] line-length = 120 -target-version = "py38" +target-version = "py39" [tool.ruff.lint] select = ["B", "C4", "E", "F", "I", "T10", "YTT", "W"] -