MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / _ensure_string_list

Function _ensure_string_list

server/services/batch_parser.py:181–192  ·  view source on GitHub ↗
(value: Any, row_index: int, field: str)

Source from the content-addressed store, hash-verified

179
180
181def _ensure_string_list(value: Any, row_index: int, field: str) -> List[str]:
182 if not isinstance(value, list):
183 raise ValidationError(
184 f"{field} must be a JSON list",
185 details={"row_index": row_index},
186 )
187 result: List[str] = []
188 for item in value:
189 if item is None or (isinstance(item, float) and pd.isna(item)):
190 continue
191 result.append(str(item))
192 return result

Callers 1

_parse_json_listFunction · 0.85

Calls 1

ValidationErrorClass · 0.90

Tested by

no test coverage detected