uranusjr commented on a change in pull request #19471:
URL: https://github.com/apache/airflow/pull/19471#discussion_r751042377



##########
File path: airflow/cli/commands/dag_command.py
##########
@@ -441,3 +442,10 @@ def dag_test(args, session=None):
             _display_dot_via_imgcat(dot_graph)
         if show_dagrun:
             print(dot_graph.source)
+
+
+@provide_session
+@cli_utils.action_logging
+def dag_reserialize(args, session=None):
+    session.query(SerializedDagModel).delete()
+    session.commit()

Review comment:
       ```suggestion
   @provide_session
   @cli_utils.action_logging
   def dag_reserialize(args, session=None):
       session.query(SerializedDagModel).delete(synchronize_session=False)
   ```
   
   Skip synchronisation to make the operation slightly faster. The session is 
going to end immediately after this so there’s no point to keep things in sync.
   
   The `provide_session` decorator calls `commit()` automatically, we don’t 
need to do that again.




-- 
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