def export_dashboards(print_stdout, dashboard_file): """Export dashboards to JSON""" data = dashboard_import_export.export_dashboards(db.session) if print_stdout or not dashboard_file: print(data) if dashboard_file: logging.info('Exporting dashboards to %s', dashboard_file) with open(dashboard_file, 'w') as data_stream: data_stream.write(data)
def export_dashboards(dashboard_file: str, print_stdout: bool) -> None: """Export dashboards to JSON""" from superset.utils import dashboard_import_export data = dashboard_import_export.export_dashboards(db.session) if print_stdout or not dashboard_file: print(data) if dashboard_file: logger.info("Exporting dashboards to %s", dashboard_file) with open(dashboard_file, "w") as data_stream: data_stream.write(data)
def export_dashboards(dashboard_file: Optional[str], print_stdout: bool = False) -> None: """Export dashboards to JSON""" # pylint: disable=import-outside-toplevel from superset.utils import dashboard_import_export data = dashboard_import_export.export_dashboards(db.session) if print_stdout or not dashboard_file: print(data) if dashboard_file: logger.info("Exporting dashboards to %s", dashboard_file) with open(dashboard_file, "w") as data_stream: data_stream.write(data)