You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/22 13:16:09 UTC

[GitHub] [airflow] mikemoto opened a new pull request #19746: Add import serialized dag model

mikemoto opened a new pull request #19746:
URL: https://github.com/apache/airflow/pull/19746


   <!--
   
   models/__init__.py has not import SerializedDagModel serialized_dag.py, so add it. I changed airflow(in site-packages) in my local enviroment, and it works, so I want to open a pull request.
   
   How to write a good git commit message:
   http://chris.beams.io/posts/git-commit/
   -->
   
   ---
   **^ Add meaningful description above**
   
   Read the **[Pull Request Guidelines](https://github.com/apache/airflow/blob/main/CONTRIBUTING.rst#pull-request-guidelines)** for more information.
   In case of fundamental code change, Airflow Improvement Proposal ([AIP](https://cwiki.apache.org/confluence/display/AIRFLOW/Airflow+Improvements+Proposals)) is needed.
   In case of a new dependency, check compliance with the [ASF 3rd Party License Policy](https://www.apache.org/legal/resolved.html#category-x).
   In case of backwards incompatible changes please leave a note in [UPDATING.md](https://github.com/apache/airflow/blob/main/UPDATING.md).
   


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



[GitHub] [airflow] mikemoto edited a comment on pull request #19746: Add import serialized dag model

Posted by GitBox <gi...@apache.org>.
mikemoto edited a comment on pull request #19746:
URL: https://github.com/apache/airflow/pull/19746#issuecomment-976110059


   > > `models/__init__.py` has not import SerializedDagModel serialized_dag.py, so add it. I changed airflow(in site-packages) in my local enviroment, and it works, so I want to open a pull request.
   > 
   > Why is this needed?
   
   In my case, i want to add a dag file, and start dagrun immediately. I search for a function to add dag in directory [airflow.api.common.experimental], but nothing found. So i try to write the code myself, my codes are shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962581-8302c586-0f11-49d3-aef1-cfcc687e2c34.png)
   
   As in the picture, SerializedDagModel.write_dag has been commented. Then i try to run the code, exception was raised:
   ![image](https://user-images.githubusercontent.com/4498225/142962468-97d211a8-f470-4a37-a8d9-46c88aa58f52.png)
   
   I read the code, and see the function call relationship shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962900-053875be-a0eb-400f-80f5-4c09e04522d9.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962934-72f85947-616c-47ee-83ce-df56c2b87da6.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962973-c3a75fbc-2cc7-42d0-ad92-88fbd9abfac2.png)
   
   When I want to trigger dagrun, SerializedDagModel of the dag should already be in database, so i need to use SerializedDagModel.write_dag in my code. 
   
   And I find that nearly all Model classes are imported in models/__init__.py as is shown below. 
   ![image](https://user-images.githubusercontent.com/4498225/142963677-c0dcdf73-f805-4d25-bc2d-bfb9b15972d9.png)
   
   So I try to import SerializedDagModel too.


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



[GitHub] [airflow] ashb commented on pull request #19746: Add import serialized dag model

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #19746:
URL: https://github.com/apache/airflow/pull/19746#issuecomment-976526675


   SeriializedDagModel is not imported on purpose, as it's not really part of the public API (we don't do a good job of communicating what is or isn't)
   
   `dag_bag.sync_to_db()` will handle all of this for you though.


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



[GitHub] [airflow] mikemoto edited a comment on pull request #19746: Add import serialized dag model

Posted by GitBox <gi...@apache.org>.
mikemoto edited a comment on pull request #19746:
URL: https://github.com/apache/airflow/pull/19746#issuecomment-976110059


   > > `models/__init__.py` has not import SerializedDagModel serialized_dag.py, so add it. I changed airflow(in site-packages) in my local enviroment, and it works, so I want to open a pull request.
   > 
   > Why is this needed?
   
   In my case, i want to add a dag file, and start dagrun immediately. I search for a function to add dag in directory [airflow.api.common.experimental], but nothing found. So i try to write the code myself, my codes are shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962581-8302c586-0f11-49d3-aef1-cfcc687e2c34.png)
   
   As in the picture, SerializedDagModel.write_dag has been commented. Then i try to run the code, exception was raised:
   ![image](https://user-images.githubusercontent.com/4498225/142962468-97d211a8-f470-4a37-a8d9-46c88aa58f52.png)
   
   I read the code, and see the function call relationship shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962900-053875be-a0eb-400f-80f5-4c09e04522d9.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962934-72f85947-616c-47ee-83ce-df56c2b87da6.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962973-c3a75fbc-2cc7-42d0-ad92-88fbd9abfac2.png)
   
   When I want to trigger dagrun, SerializedDagModel of the dag should already be in database, so i need to use SerializedDagModel.write_dag in my code. 
   
   And I find that nearly all Model classes are imported in models/__init__.py as is shown below. 
   ![image](https://user-images.githubusercontent.com/4498225/142963634-76fe2864-8e23-4cba-8ce4-e071fc40d8bb.png)
   
   So I try to import SerializedDagModel too.


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



[GitHub] [airflow] ashb commented on pull request #19746: Add import serialized dag model

Posted by GitBox <gi...@apache.org>.
ashb commented on pull request #19746:
URL: https://github.com/apache/airflow/pull/19746#issuecomment-975540514


   >  `models/__init__.py` has not import SerializedDagModel serialized_dag.py, so add it. I changed airflow(in site-packages) in my local enviroment, and it works, so I want to open a pull request.
   
   Why is this needed?


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



[GitHub] [airflow] mikemoto closed pull request #19746: Add import serialized dag model

Posted by GitBox <gi...@apache.org>.
mikemoto closed pull request #19746:
URL: https://github.com/apache/airflow/pull/19746


   


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



[GitHub] [airflow] mikemoto edited a comment on pull request #19746: Add import serialized dag model

Posted by GitBox <gi...@apache.org>.
mikemoto edited a comment on pull request #19746:
URL: https://github.com/apache/airflow/pull/19746#issuecomment-976110059


   > > `models/__init__.py` has not import SerializedDagModel serialized_dag.py, so add it. I changed airflow(in site-packages) in my local enviroment, and it works, so I want to open a pull request.
   > 
   > Why is this needed?
   
   In my case, i want to add a dag file, and start dagrun immediately. I search for a function to add dag in directory [airflow.api.common.experimental], but nothing found. So i try to write the code myself, my codes are shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962581-8302c586-0f11-49d3-aef1-cfcc687e2c34.png)
   
   As in the picture, the function [SerializedDagModel.write_dag] has been commented. Then i try to run the code, exception was raised (by the way, this code works well in airflow 1.10.X, but i want to migrate my work on latest version of airflow):
   ![image](https://user-images.githubusercontent.com/4498225/142962468-97d211a8-f470-4a37-a8d9-46c88aa58f52.png)
   
   I read the code, and see the function call relationship shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962900-053875be-a0eb-400f-80f5-4c09e04522d9.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962934-72f85947-616c-47ee-83ce-df56c2b87da6.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962973-c3a75fbc-2cc7-42d0-ad92-88fbd9abfac2.png)
   
   When I want to trigger dagrun, SerializedDagModel of the dag should already be in database, so i need to use SerializedDagModel.write_dag in my code. 
   
   And I find that nearly all Model classes are imported in models/__init__.py as is shown below. 
   ![image](https://user-images.githubusercontent.com/4498225/142963677-c0dcdf73-f805-4d25-bc2d-bfb9b15972d9.png)
   
   So I try to import SerializedDagModel too.


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



[GitHub] [airflow] mikemoto commented on pull request #19746: Add import serialized dag model

Posted by GitBox <gi...@apache.org>.
mikemoto commented on pull request #19746:
URL: https://github.com/apache/airflow/pull/19746#issuecomment-976110059


   > > `models/__init__.py` has not import SerializedDagModel serialized_dag.py, so add it. I changed airflow(in site-packages) in my local enviroment, and it works, so I want to open a pull request.
   > 
   > Why is this needed?
   
   In my case, i want to add a dag file, and start dagrun immediately. I search for a function to add dag in directory [airflow.api.common.experimental], but nothing found. So i try to write the code myself, my codes are shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962581-8302c586-0f11-49d3-aef1-cfcc687e2c34.png)
   
   As in the picture, SerializedDagModel.write_dag has been commented. Then i try to run the code, exception was raised:
   ![image](https://user-images.githubusercontent.com/4498225/142962468-97d211a8-f470-4a37-a8d9-46c88aa58f52.png)
   
   I read the code, and see the function call relationship shown below:
   ![image](https://user-images.githubusercontent.com/4498225/142962900-053875be-a0eb-400f-80f5-4c09e04522d9.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962934-72f85947-616c-47ee-83ce-df56c2b87da6.png)
   ![image](https://user-images.githubusercontent.com/4498225/142962973-c3a75fbc-2cc7-42d0-ad92-88fbd9abfac2.png)
   
   When I want to trigger dagrun, SerializedDagModel of the dag should already be in database, so i need to use SerializedDagModel.write_dag in my code. And I find that nearly all Model classes are imported in models/__init__.py, so I try to import SerializedDagModel too


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