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

Function validate_limit_direction

pandas/core/missing.py:278–290  ·  view source on GitHub ↗
(
    limit_direction: str,
)

Source from the content-addressed store, hash-verified

276
277
278def validate_limit_direction(
279 limit_direction: str,
280) -> Literal["forward", "backward", "both"]:
281 valid_limit_directions = ["forward", "backward", "both"]
282 limit_direction = limit_direction.lower()
283 if limit_direction not in valid_limit_directions:
284 raise ValueError(
285 "Invalid limit_direction: expecting one of "
286 f"{valid_limit_directions}, got '{limit_direction}'."
287 )
288 # error: Incompatible return value type (got "str", expected
289 # "Literal['forward', 'backward', 'both']")
290 return limit_direction # type: ignore[return-value]
291
292
293def validate_limit_area(limit_area: str | None) -> Literal["inside", "outside"] | None:

Callers 1

interpolate_2d_inplaceFunction · 0.85

Calls 1

lowerMethod · 0.80

Tested by

no test coverage detected