From c2592248482c087807d550c8304fa3703744cdf2 Mon Sep 17 00:00:00 2001 From: Sebastiaan Huber Date: Mon, 22 May 2023 09:57:21 +0200 Subject: [PATCH] Pre-commit: Fix `mypy` warning in `aiida.orm.utils.serialize` --- aiida/orm/utils/serialize.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aiida/orm/utils/serialize.py b/aiida/orm/utils/serialize.py index a5cb5a1bec..5715d9b346 100644 --- a/aiida/orm/utils/serialize.py +++ b/aiida/orm/utils/serialize.py @@ -210,6 +210,8 @@ def serialize(data: Any, encoding: str | None = None) -> str | bytes: :param encoding: optional encoding for the serialized string :return: string representation of the serialized data structure or byte array if specific encoding is specified """ + serialized: bytes | str + if encoding is not None: serialized = yaml.dump(data, encoding=encoding, Dumper=AiiDADumper) else: