You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "mhenc (via GitHub)" <gi...@apache.org> on 2023/02/01 12:22:16 UTC

[GitHub] [airflow] mhenc commented on a diff in pull request #29188: AIP-44 Migrate Dagbag.sync_to_db to internal API.

mhenc commented on code in PR #29188:
URL: https://github.com/apache/airflow/pull/29188#discussion_r1093145804


##########
airflow/dag_processing/processor.py:
##########
@@ -837,3 +832,26 @@ def process_file(
             self.log.exception("Error logging DAG warnings.")
 
         return len(dagbag.dags), len(dagbag.import_errors)
+
+    @staticmethod
+    @internal_api_call
+    @provide_session
+    def save_dag_to_db(

Review Comment:
   Please add types.



##########
airflow/dag_processing/processor.py:
##########
@@ -837,3 +832,26 @@ def process_file(
             self.log.exception("Error logging DAG warnings.")
 
         return len(dagbag.dags), len(dagbag.import_errors)
+
+    @staticmethod
+    @internal_api_call
+    @provide_session
+    def save_dag_to_db(
+        dags, pickle_dags, dagbag_import_error_traceback_depth, dag_directory, session=NEW_SESSION

Review Comment:
   dags are only used in line 847 below:
   ```
           dag_ids = [dag.id for dag in dags]
   ```
   so we can just pass `dag_ids` there, to avoid problem with DagBag serialization.



-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org