def select_node_fields_by_parent_path(
        self,
        dataset_rows: "DataTable",
        parent_path: str,
        fields: Iterable[str],
    ) -> Iterator[tuple[Any, ...]]:
        """
        Gets latest-version file nodes from the provided parent path
        """
        dr = dataset_rows
        de = dr.dir_expansion()
        q = de.query(
            dr.select().where(dr.c("is_latest") == true()).subquery()
        ).subquery()
        where_cond = pathfunc.parent(de.c(q, "path")) == parent_path
        if parent_path == "":
            # Exclude the root dir
            where_cond = where_cond & (de.c(q, "path") != "")
        inner_query = self.expand_query(de, q, dr).where(where_cond).subquery()

        def field_to_expr(f):
            if f == "name":
                return pathfunc.name(de.c(inner_query, "path"))
            return de.c(inner_query, f)

        return self.db.execute(
            sa.select(*(field_to_expr(f) for f in fields)).order_by(
                de.c(inner_query, "source"),
                de.c(inner_query, "path"),
                de.c(inner_query, "version"),
            )
        )

        Gets latest-version file nodes from the provided parent path
        
src/datachain/data_storage/warehouse.py