Skip to content

ExcludeDir

Bases: BaseFileFilter, FrozenModel

Filter files or directories which are included in a specific directory.

Added in 0.8.0

Replaces deprecated onetl.core.FileFilter

Parameters:

  • path (str | PathLike) –

    Path to directory which should be excluded.

Examples:

Create exclude dir filter:

from onetl.file.filter import ExcludeDir

exclude_dir = ExcludeDir("/export/news_parse/exclude_dir")

match(path)

Returns True if path is matching the filter, False otherwise

Added in 0.8.0

Examples:

>>> from onetl.impl import LocalPath
>>> filter.match(LocalPath("/path/to/file.csv"))
True
>>> filter.match(LocalPath("/path/to/excluded.csv"))
False
>>> filter.match(LocalPath("/path/to/file.csv"))
True