🐛 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:
parent
88dbff7bf5
commit
6431b50fa6
1 changed files with 2 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
from collections import defaultdict
|
||||||
import re
|
import re
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
|
|
@ -47,7 +48,7 @@ class FrontendNode(BaseModel):
|
||||||
name: str = ""
|
name: str = ""
|
||||||
display_name: str = ""
|
display_name: str = ""
|
||||||
documentation: str = ""
|
documentation: str = ""
|
||||||
custom_fields: List[str] = []
|
custom_fields: defaultdict = defaultdict(list)
|
||||||
output_types: List[str] = []
|
output_types: List[str] = []
|
||||||
field_formatters: FieldFormatters = Field(default_factory=FieldFormatters)
|
field_formatters: FieldFormatters = Field(default_factory=FieldFormatters)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue