From e5987274025bbac8471aa1c585154b6cdf0188df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20RAILLET?= Date: Fri, 12 Dec 2025 14:59:57 +0100 Subject: [PATCH] fix: bad type hint on to_flat_dicts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous return type of the to_flat_dicts function (List[FlatDeltaRow]) was incorrect, which generated numerous warnings when running mypy on applications using deepdiff. This commit resolves the issue by correcting the type hint to the appropriate type. Also, corresponding # type ignore is removed as it's now useless. Signed-off-by: Sébastien RAILLET --- deepdiff/delta.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepdiff/delta.py b/deepdiff/delta.py index 0774502..bf2b831 100644 --- a/deepdiff/delta.py +++ b/deepdiff/delta.py @@ -1065,7 +1065,7 @@ def _from_flat_dicts(flat_dict_list): return result - def to_flat_dicts(self, include_action_in_path=False, report_type_changes=True) -> List[FlatDeltaRow]: + def to_flat_dicts(self, include_action_in_path=False, report_type_changes=True) -> List[dict[str, Any]]: """ Returns a flat list of actions that is easily machine readable. @@ -1121,7 +1121,7 @@ def to_flat_dicts(self, include_action_in_path=False, report_type_changes=True) """ return [ i._asdict() for i in self.to_flat_rows(include_action_in_path=False, report_type_changes=True) - ] # type: ignore + ] def to_flat_rows(self, include_action_in_path=False, report_type_changes=True) -> List[FlatDeltaRow]: """