File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ def _simple_json_normalize(
269269
270270def _validate_meta (meta : list ) -> None :
271271 """
272- Validate that meta parameter contains only strings.
272+ Validate that meta parameter contains only strings or lists of strings .
273273
274274 Parameters
275275 ----------
@@ -279,12 +279,19 @@ def _validate_meta(meta: list) -> None:
279279 Raises
280280 ------
281281 TypeError
282- If meta contains non-string elements.
282+ If meta contains elements that are not strings or lists of strings .
283283 """
284284 for item in meta :
285- if not isinstance (item , str ):
285+ if isinstance (item , list ):
286+ for subitem in item :
287+ if not isinstance (subitem , str ):
288+ raise TypeError (
289+ "All elements in nested meta paths must be strings. "
290+ f"Found { type (subitem ).__name__ } : { subitem !r} "
291+ )
292+ elif not isinstance (item , str ):
286293 raise TypeError (
287- "All elements in 'meta' must be strings. "
294+ "All elements in 'meta' must be strings or lists of strings . "
288295 f"Found { type (item ).__name__ } : { item !r} "
289296 )
290297
You can’t perform that action at this time.
0 commit comments