🐛 fix(base.py): change custom_fields default value from an empty list to a defaultdict to prevent potential errors

The custom_fields attribute in the FrontendNode class now has a default value of defaultdict(list) instead of an empty list. This change ensures that custom_fields is always a defaultdict, which prevents potential errors when accessing or modifying the custom_fields attribute.
This commit is contained in:
Gabriel Luiz Freitas Almeida 2023-07-03 23:11:08 -03:00
commit 6431b50fa6

View file

@ -1,3 +1,4 @@
from collections import defaultdict
import re
from typing import List, Optional
@ -47,7 +48,7 @@ class FrontendNode(BaseModel):
name: str = ""
display_name: str = ""
documentation: str = ""
custom_fields: List[str] = []
custom_fields: defaultdict = defaultdict(list)
output_types: List[str] = []
field_formatters: FieldFormatters = Field(default_factory=FieldFormatters)