class_docstr: Prunes logs from all report schedules
class_docstr_tok: ["Prunes","logs","from","all","report","schedules"]
code: def run(self) -> None:
      self.validate()
      prune_errors = []
  
      for report_schedule in db.session.query(ReportSchedule).all():
          if report_schedule.log_retention is not None:
              from_date = datetime.utcnow() - timedelta(
                  days=report_schedule.log_retention
              )
              try:
                  row_count = ReportScheduleDAO.bulk_delete_logs(
                      report_schedule, from_date, commit=False
                  )
                  logger.info(
                      "Deleted %s logs for report schedule id: %s",
                      str(row_count),
                      str(report_schedule.id),
                  )
              except DAODeleteFailedError as ex:
                  prune_errors.append(str(ex))
      if prune_errors:
          raise ReportSchedulePruneLogError(";".join(prune_errors))
  
file_path: superset/superset/commands/report/log_prune.py
imports: import logging
  from datetime import datetime, timedelta
  from superset import db
  from superset.commands.base import BaseCommand
  from superset.commands.report.exceptions import ReportSchedulePruneLogError
  from superset.daos.exceptions import DAODeleteFailedError
  from superset.daos.report import ReportScheduleDAO
  from superset.reports.models import ReportSchedule
label_desc: Use image node_id 2 for calling the AsyncPruneReportScheduleLogCommand obj's underlying member method code with example usage: obj.run() without return types