refactor: Serialize text data to JSON format in parse_text_file_to_data
This commit is contained in:
parent
cd011a96b9
commit
98ecdf3e3e
1 changed files with 1 additions and 0 deletions
|
|
@ -140,6 +140,7 @@ def parse_text_file_to_data(file_path: str, silent_errors: bool) -> Optional[Dat
|
|||
text = {k: normalize_text(v) if isinstance(v, str) else v for k, v in text.items()}
|
||||
elif isinstance(text, list):
|
||||
text = [normalize_text(item) if isinstance(item, str) else item for item in text]
|
||||
text = orjson.dumps(text).decode("utf-8")
|
||||
|
||||
elif file_path.endswith(".yaml") or file_path.endswith(".yml"):
|
||||
text = yaml.safe_load(text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue