From 967bf5a16f4e78ead0f4e443c3770b636fdc9bca Mon Sep 17 00:00:00 2001 From: Bruno FS Ciconelle Date: Mon, 8 Jul 2024 14:21:29 -0300 Subject: [PATCH] fix: make code compatible with python 3.8 --- src/json_agg/aggregates.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/json_agg/aggregates.py b/src/json_agg/aggregates.py index 50c35e4..412d1f4 100644 --- a/src/json_agg/aggregates.py +++ b/src/json_agg/aggregates.py @@ -1,7 +1,8 @@ """JSON themed aggregates for Django.""" +from __future__ import annotations + import abc -from collections.abc import Callable from functools import partial from typing import Any @@ -37,7 +38,7 @@ def _nested_db_converter(self, value, expression, connection, db_converter): def _nested_to_python(self, value, expression, connection): return self._convert_nested_value(value, self.nested_output_field.to_python) - def get_db_converters(self, connection: Any) -> list[Callable[..., Any]]: + def get_db_converters(self, connection: Any) -> list[callable[..., Any]]: """Override Django's BaseExpression method to handle nested output fields.""" converters = super().get_db_converters(connection) if not self.nested_output_field: