ephraimbuddy commented on code in PR #29058:
URL: https://github.com/apache/airflow/pull/29058#discussion_r1085055480
##########
airflow/utils/db_cleanup.py:
##########
@@ -159,6 +170,14 @@ def _do_delete(*, query, orm_model, skip_archive, session):
logger.debug("delete statement:\n%s", delete.compile())
session.execute(delete)
session.commit()
+ if export_to_csv:
+ if not output_path.startswith(AIRFLOW_HOME):
+ output_path = os.path.join(AIRFLOW_HOME, output_path)
+ os.makedirs(output_path, exist_ok=True)
+ _to_csv(
+ target_table=target_table,
file_path=f"{output_path}/{target_table_name}.csv", session=session
+ )
+ skip_archive = True
Review Comment:
I think it depends on how you look at this. If `--export-to-csv` means
exporting what is in the archive then explicit skip(`--skip-archive`) sounds
good. However, if `--export-to-csv` means to archive data in csv, then forcing
skip archive sounds good to me since the data is now archived in csv files.
I had this discussion with @norm, also @jedcunningham mentioned this too
when we talked about the idea. WDYT: @norm @jedcunningham
--
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]