python/ray/data/datasource/partitioning.py
def _parse_dir_path(self, dir_path: str) -> Dict[str, str]:
        """Directory partition path parser.

        Returns a dictionary mapping directory partition keys to values from a
        partition path of the form "{value1}/{value2}/..." or an empty dictionary for
        unpartitioned files.

        Requires a corresponding ordered list of partition key field names to map the
        correct key to each value.
        """
        dirs = [d for d in dir_path.split("/") if d]
        field_names = self._scheme.field_names
        assert not dirs or len(dirs) == len(field_names), (
            f"Expected {len(field_names)} partition value(s) but found "
            f"{len(dirs)}: {dirs}."
        )
        return {field_names[i]: d for i, d in enumerate(dirs)} if dirs else {}
Directory partition path parser.

        Returns a dictionary mapping directory partition keys to values from a
        partition path of the form "{value1}/{value2}/..." or an empty dictionary for
        unpartitioned files.

        Requires a corresponding ordered list of partition key field names to map the
        correct key to each value.
        
Directory partition path parser.
Returns a dictionary mapping directory partition keys to values from a
partition path of the form "{value1}/{value2}/..." or an empty dictionary for
unpartitioned files.

Requires a corresponding ordered list of partition key field names to map the
correct key to each value.
Directory partition path parser . Returns a dictionary mapping directory partition keys to values from a partition path of the form " { value1 } / { value2 } / ... " or an empty dictionary for unpartitioned files . Requires a corresponding ordered list of partition key field names to map the correct key to each value .
def _parse_dir_path(self, dir_path: str) -> Dict[str, str]:
        dirs = [d for d in dir_path.split("/") if d]
        field_names = self._scheme.field_names
        assert not dirs or len(dirs) == len(field_names), (
            f"Expected {len(field_names)} partition value(s) but found "
            f"{len(dirs)}: {dirs}."
        )
        return {field_names[i]: d for i, d in enumerate(dirs)} if dirs else {}
def _parse_dir_path ( self , dir_path : str ) -> Dict [ str , str ] : dirs = [ d for d in dir_path . split ( "/" ) if d ] field_names = self . _scheme . field_names assert not dirs or len ( dirs ) == len ( field_names ) , ( f"Expected {len(field_names)} partition value(s) but found " f"{len(dirs)}: {dirs}." ) return { field_names [ i ] : d for i , d in enumerate ( dirs ) } if dirs else { }
Directory partition path parser.
Directory partition path parser .
"""Directory partition path parser.

        Returns a dictionary mapping directory partition keys to values from a
        partition path of the form "{value1}/{value2}/..." or an empty dictionary for
        unpartitioned files.

        Requires a corresponding ordered list of partition key field names to map the
        correct key to each value.
        """
self
dir_path
str