fix: update CreateData.py (#2975)
* Update CreateData.py Update to generate data correctly * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
612b1ff768
commit
3cd0161c9a
1 changed files with 3 additions and 8 deletions
|
|
@ -63,21 +63,16 @@ class CreateDataComponent(Component):
|
||||||
build_config["number_of_fields"]["value"] = field_value_int
|
build_config["number_of_fields"]["value"] = field_value_int
|
||||||
return build_config
|
return build_config
|
||||||
|
|
||||||
async def build_data(
|
async def build_data(self) -> Data:
|
||||||
self,
|
|
||||||
number_of_fields: int = 0,
|
|
||||||
text_key: str = "text",
|
|
||||||
**kwargs,
|
|
||||||
) -> Data:
|
|
||||||
data = {}
|
data = {}
|
||||||
for value_dict in kwargs.values():
|
for value_dict in self._attributes.values():
|
||||||
if isinstance(value_dict, dict):
|
if isinstance(value_dict, dict):
|
||||||
# Check if the value of the value_dict is a Data
|
# Check if the value of the value_dict is a Data
|
||||||
value_dict = {
|
value_dict = {
|
||||||
key: value.get_text() if isinstance(value, Data) else value for key, value in value_dict.items()
|
key: value.get_text() if isinstance(value, Data) else value for key, value in value_dict.items()
|
||||||
}
|
}
|
||||||
data.update(value_dict)
|
data.update(value_dict)
|
||||||
return_data = Data(data=data, text_key=text_key)
|
return_data = Data(data=data, text_key=self.text_key)
|
||||||
self.status = return_data
|
self.status = return_data
|
||||||
return return_data
|
return return_data
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue