ephraimbuddy commented on code in PR #29058:
URL: https://github.com/apache/airflow/pull/29058#discussion_r1091027961


##########
airflow/utils/db_cleanup.py:
##########
@@ -370,3 +383,19 @@ def run_cleanup(
                 session=session,
             )
             session.commit()
+
+
+@provide_session
+def export_archived_records(export_format, output_path, session: Session = 
NEW_SESSION):
+    """Export cleaned data to the given output path in the given format."""
+    inspector = inspect(session.bind)
+    table_names = inspector.get_table_names()
+    for table_name in table_names:
+        if table_name.startswith(ARCHIVE_TABLE_PREFIX):
+            _dump_db(
+                target_table=table_name,
+                file_path=os.path.join(output_path, 
f"{table_name}.{export_format}"),
+                export_format=export_format,
+                session=session,
+            )

Review Comment:
   Also thinking of adding table names so one can export specific archive 
tables. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to