python/ray/data/impl/stats.py
def summary_string(self, already_printed: Set[str] = None) -> str:
        """Return a human-readable summary of this Dataset's stats."""
        if already_printed is None:
            already_printed = set()

        if self.needs_stats_actor:
            # XXX this is a super hack, clean it up.
            stats_map, self.time_total_s = ray.get(
                self.stats_actor.get.remote(self.stats_uuid)
            )
            for i, metadata in stats_map.items():
                self.stages["read"][i] = metadata
        out = ""
        if self.parents:
            for p in self.parents:
                parent_sum = p.summary_string(already_printed)
                if parent_sum:
                    out += parent_sum
                    out += "\n"
        if len(self.stages) == 1:
            stage_name, metadata = next(iter(self.stages.items()))
            stage_uuid = self.dataset_uuid + stage_name
            out += "Stage {} {}: ".format(self.number, stage_name)
            if stage_uuid in already_printed:
                out += "[execution cached]"
            else:
                already_printed.add(stage_uuid)
                out += self._summarize_blocks(metadata, is_substage=False)
        elif len(self.stages) > 1:
            rounded_total = round(self.time_total_s, 2)
            if rounded_total <= 0:
                # Handle -0.0 case.
                rounded_total = 0
            out += "Stage {} {}: executed in {}s\n".format(
                self.number, self.base_name, rounded_total
            )
            for n, (stage_name, metadata) in enumerate(self.stages.items()):
                stage_uuid = self.dataset_uuid + stage_name
                out += "\n"
                out += "\tSubstage {} {}: ".format(n, stage_name)
                if stage_uuid in already_printed:
                    out += "\t[execution cached]"
                else:
                    already_printed.add(stage_uuid)
                    out += self._summarize_blocks(metadata, is_substage=True)
        out += self._summarize_iter()
        return out
Return a human-readable summary of this Dataset's stats.
Return a human-readable summary of this Dataset's stats.
Return a human - readable summary of this Dataset ' s stats .
def summary_string(self, already_printed: Set[str] = None) -> str:
        if already_printed is None:
            already_printed = set()
        if self.needs_stats_actor:
            stats_map, self.time_total_s = ray.get(
                self.stats_actor.get.remote(self.stats_uuid)
            )
            for i, metadata in stats_map.items():
                self.stages["read"][i] = metadata
        out = ""
        if self.parents:
            for p in self.parents:
                parent_sum = p.summary_string(already_printed)
                if parent_sum:
                    out += parent_sum
                    out += "\n"
        if len(self.stages) == 1:
            stage_name, metadata = next(iter(self.stages.items()))
            stage_uuid = self.dataset_uuid + stage_name
            out += "Stage {} {}: ".format(self.number, stage_name)
            if stage_uuid in already_printed:
                out += "[execution cached]"
            else:
                already_printed.add(stage_uuid)
                out += self._summarize_blocks(metadata, is_substage=False)
        elif len(self.stages) > 1:
            rounded_total = round(self.time_total_s, 2)
            if rounded_total <= 0:
                rounded_total = 0
            out += "Stage {} {}: executed in {}s\n".format(
                self.number, self.base_name, rounded_total
            )
            for n, (stage_name, metadata) in enumerate(self.stages.items()):
                stage_uuid = self.dataset_uuid + stage_name
                out += "\n"
                out += "\tSubstage {} {}: ".format(n, stage_name)
                if stage_uuid in already_printed:
                    out += "\t[execution cached]"
                else:
                    already_printed.add(stage_uuid)
                    out += self._summarize_blocks(metadata, is_substage=True)
        out += self._summarize_iter()
        return out
def summary_string ( self , already_printed : Set [ str ] = None ) -> str : if already_printed is None : already_printed = set ( ) if self . needs_stats_actor : stats_map , self . time_total_s = ray . get ( self . stats_actor . get . remote ( self . stats_uuid ) ) for i , metadata in stats_map . items ( ) : self . stages [ "read" ] [ i ] = metadata out = "" if self . parents : for p in self . parents : parent_sum = p . summary_string ( already_printed ) if parent_sum : out += parent_sum out += "\n" if len ( self . stages ) == 1 : stage_name , metadata = next ( iter ( self . stages . items ( ) ) ) stage_uuid = self . dataset_uuid + stage_name out += "Stage {} {}: " . format ( self . number , stage_name ) if stage_uuid in already_printed : out += "[execution cached]" else : already_printed . add ( stage_uuid ) out += self . _summarize_blocks ( metadata , is_substage = False ) elif len ( self . stages ) > 1 : rounded_total = round ( self . time_total_s , 2 ) if rounded_total <= 0 : rounded_total = 0 out += "Stage {} {}: executed in {}s\n" . format ( self . number , self . base_name , rounded_total ) for n , ( stage_name , metadata ) in enumerate ( self . stages . items ( ) ) : stage_uuid = self . dataset_uuid + stage_name out += "\n" out += "\tSubstage {} {}: " . format ( n , stage_name ) if stage_uuid in already_printed : out += "\t[execution cached]" else : already_printed . add ( stage_uuid ) out += self . _summarize_blocks ( metadata , is_substage = True ) out += self . _summarize_iter ( ) return out
Return a human-readable summary of this Dataset's stats.
Return a human - readable summary of this Dataset ' s stats .
"""Return a human-readable summary of this Dataset's stats.""" # XXX this is a super hack, clean it up. # Handle -0.0 case.
self
already_printed
Set[str]