Skip to content

Commit 100de6f

Browse files
authored
Modify _validate_meta to accept multiple types
Updated the _validate_meta function to accept a string or a list of strings/lists of strings as input.
1 parent ddbe74c commit 100de6f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pandas/io/json/_normalize.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,20 +267,22 @@ def _simple_json_normalize(
267267
return normalized_json_object
268268

269269

270-
def _validate_meta(meta: list) -> None:
270+
def _validate_meta(meta: str | list[str | list[str]]) -> None:
271271
"""
272272
Validate that meta parameter contains only strings or lists of strings.
273273
274274
Parameters
275275
----------
276-
meta : list
276+
meta : str or list of str or list of list of str
277277
The meta parameter to validate.
278278
279279
Raises
280280
------
281281
TypeError
282282
If meta contains elements that are not strings or lists of strings.
283283
"""
284+
if isinstance(meta, str):
285+
return
284286
for item in meta:
285287
if isinstance(item, list):
286288
for subitem in item:

0 commit comments

Comments
 (0)