limits_stop_at#

onetl.file.limit.limits_stop_at.limits_stop_at(path: PathProtocol, limits: Iterable[BaseFileLimit]) bool#

Check if some of limits stops at given path.

Parameters:
pathonetl.base.path_protocol.PathProtocol

Path to check.

limitsIterable of onetl.base.base_file_limit.BaseFileLimit

Limits to test path against.

Returns:
True if any of limit is reached while handling the path, False otherwise.
If no limits are passed, returns False.

Examples

from onetl.file.limit import MaxFilesCount, limits_stop_at
from onetl.impl import LocalPath

limits = [MaxFilesCount(1)]

assert not limits_stop_at(LocalPath("/path/to/file.csv"), limits)
assert limits_stop_at(LocalPath("/path/to/file.csv"), limits)