def build_doc()

in src/es_pii_tool/trackables.py [0:0]


    def build_doc(self) -> t.Dict:
        """Build the dictionary which will be the written to the tracking doc

        :returns: The tracking doc dictionary
        """
        doc = {}
        self.update_status()
        for key in self.ATTRLIST:
            if key in self.status:
                doc[key] = self.status[key]
        # Only add this field if self.index is not empty/None
        if self.index:
            doc['index'] = self.index
        # Only add this field if self.stepname is not empty/None
        if self.stepname:
            doc['step'] = self.stepname
        # Only add this field if self.task_id not empty/None
        if self.task_id:
            doc['task'] = self.task_id  # Necessary for the parent-child relationship
        doc['job'] = self.job.name
        doc['dry_run'] = self.job.dry_run
        # self.logger.debug('Updated step doc: %s', doc)
        return doc