class_docstr: Partition filter for path-based partition formats.
  
  Used to explicitly keep or reject files based on a custom filter function that
  takes partition keys and values parsed from the file's path as input.
class_docstr_tok: ["Partition","filter","for","path-based","partition","formats",".","Used","to","explicitly","keep","or","reject","files","based","on","a","custom","filter","function","that","takes","partition","keys","and","values","parsed","from","the","file","'s","path","as","input","."]
docstr: Creates a new path-based partition filter based on a parser.
  
  Args:
      path_partition_parser: The path-based partition parser.
      filter_fn: Callback used to filter partitions. Takes a dictionary mapping
          partition keys to values as input. Unpartitioned files are denoted with
          an empty input dictionary. Returns `True` to read a file for that
          partition or `False` to skip it. Partition keys and values are always
          strings read from the filesystem path. For example, this removes all
          unpartitioned files:
          ``lambda d: True if d else False``
          This raises an assertion error for any unpartitioned file found:
          ``lambda d: assert d, "Expected all files to be partitioned!"``
          And this only reads files from January, 2022 partitions:
          ``lambda d: d["month"] == "January" and d["year"] == "2022"``
docstr_tok: ["Creates","a","new","path-based","partition","filter","based","on","a","parser",".","Args",":","path_partition_parser",":","The","path-based","partition","parser",".","filter_fn",":","Callback","used","to","filter","partitions",".","Takes","a","dictionary","mapping","partition","keys","to","values","as","input",".","Unpartitioned","files","are","denoted","with","an","empty","input","dictionary",".","Returns","`","True","`","to","read","a","file","for","that","partition","or","`","False","`","to","skip","it",".","Partition","keys","and","values","are","always","strings","read","from","the","filesystem","path",".","For","example",",","this","removes","all","unpartitioned","files",":","``","lambda","d",":","True","if","d","else","False","``","This","raises","an","assertion","error","for","any","unpartitioned","file","found",":","``","lambda","d",":","assert","d",",","``","Expected","all","files","to","be","partitioned","!","``","``","And","this","only","reads","files","from","January",",","2022","partitions",":","``","lambda","d",":","d","[","``","month","''","]","==","``","January","''","and","d","[","``","year","''","]","==","``","2022","''","``"]
code: def __init__(
      self,
      path_partition_parser: PathPartitionParser,
      filter_fn: Callable[[Dict[str, str]], bool],
  ):
      """Creates a new path-based partition filter based on a parser.
  
      Args:
          path_partition_parser: The path-based partition parser.
          filter_fn: Callback used to filter partitions. Takes a dictionary mapping
              partition keys to values as input. Unpartitioned files are denoted with
              an empty input dictionary. Returns `True` to read a file for that
              partition or `False` to skip it. Partition keys and values are always
              strings read from the filesystem path. For example, this removes all
              unpartitioned files:
              ``lambda d: True if d else False``
              This raises an assertion error for any unpartitioned file found:
              ``lambda d: assert d, "Expected all files to be partitioned!"``
              And this only reads files from January, 2022 partitions:
              ``lambda d: d["month"] == "January" and d["year"] == "2022"``
      """
      self._parser = path_partition_parser
      self._filter_fn = filter_fn
  
imports: import posixpath
  from dataclasses import dataclass
  from enum import Enum
  from typing import TYPE_CHECKING, Callable, Dict, List, Optional
  from ray.util.annotations import DeveloperAPI, PublicAPI
label_desc: Use image node_id 2 to create a new PathPartitionFilter object  with example: obj = PathPartitionFilter(path_partition_parser, filter_fn)