MCPcopy
hub / github.com/pandas-dev/pandas / _validate_skipfooter_arg

Function _validate_skipfooter_arg

pandas/io/parsers/python_parser.py:1529–1557  ·  view source on GitHub ↗

Validate the 'skipfooter' parameter. Checks whether 'skipfooter' is a non-negative integer. Raises a ValueError if that is not the case. Parameters ---------- skipfooter : non-negative integer The number of rows to skip at the end of the file. Returns ----

(skipfooter: int)

Source from the content-addressed store, hash-verified

1527
1528
1529def _validate_skipfooter_arg(skipfooter: int) -> int:
1530 """
1531 Validate the 'skipfooter' parameter.
1532
1533 Checks whether 'skipfooter' is a non-negative integer.
1534 Raises a ValueError if that is not the case.
1535
1536 Parameters
1537 ----------
1538 skipfooter : non-negative integer
1539 The number of rows to skip at the end of the file.
1540
1541 Returns
1542 -------
1543 validated_skipfooter : non-negative integer
1544 The original input if the validation succeeds.
1545
1546 Raises
1547 ------
1548 ValueError : 'skipfooter' was not a non-negative integer.
1549 """
1550 if not is_integer(skipfooter):
1551 raise ValueError("skipfooter must be an integer")
1552
1553 if skipfooter < 0:
1554 raise ValueError("skipfooter cannot be negative")
1555
1556 # Incompatible return value type (got "Union[int, integer[Any]]", expected "int")
1557 return skipfooter # type: ignore[return-value]

Callers 1

__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected