From 62955c9c8a7ae268a9eaa6b14797edf402e3391e Mon Sep 17 00:00:00 2001 From: George Tsiamasiotis Date: Sun, 22 Sep 2024 12:08:13 +0300 Subject: [PATCH] Removed type annotation on FrigateConfig's parse I'd like to keep them, but then mypy complains about some fundamental errors with how the pydantic model is structured. I'd like to fix it, but I'd rather work towards moving some of this config to the database. --- frigate/config.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/config.py b/frigate/config.py index 711e82d33..aec525076 100644 --- a/frigate/config.py +++ b/frigate/config.py @@ -1743,12 +1743,12 @@ class FrigateConfig(FrigateBaseModel): return v @classmethod - def parse_file(cls, config_path, **kwargs) -> Self: + def parse_file(cls, config_path, **kwargs): with open(config_path) as f: return FrigateConfig.parse(f, **kwargs) @classmethod - def parse(cls, config, *, is_json=None, **context) -> Self: + def parse(cls, config, *, is_json=None, **context): # If config is a file, read its contents. if hasattr(config, "read"): fname = getattr(config, "name", None) @@ -1780,5 +1780,5 @@ class FrigateConfig(FrigateBaseModel): return cls.model_validate(obj, context=context) @classmethod - def parse_yaml(cls, config_yaml, **context) -> Self: + def parse_yaml(cls, config_yaml, **context): return cls.parse(config_yaml, is_json=False, **context)