You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For anyone that uses a "git sync" method for deploying their DAGs:
Without having to go into your git sync container's logs, it looks like currently the only way to confirm the new DAG changes are deployed is to look for the changes in the "Code" page of your DAG (or if there is changes that would cause a grid change you can verify the change on that page too).
However, what if you are importing a function from a separate file within the same DAG folder and you made changes to that function in that other python file? Currently there is no way to verify those changes are deployed without either simply waiting a few minutes and hoping it has synced or checking the git sync container's logs. Neither are a user-friendly way to verify the code change got deployed.
I am thinking we need a way in Airflow UI to view the code of non-DAG files. There is obviously complexity to this ask so I'll try and break it out like so:
Let's say a DAG uses code from different methods of importing modules for use in DAGs:
A "custom_package" module into your PYTHONPATH like so: PYTHONPATH=/home/arch/projects/custom_package.
A "my_company" folder inside of your "dags" folder.
A "third_party_package" package installed via pip install.
Maybe the "Code" page can be expanded to let you view the code of these modules. I am thinking some possible ways:
Option 1: List of imported modules to switch to on the "Code" page:
Show a list of files based on what was imported in the DAG, so you can click on the name and view the code of that file. For the above examples it will be these files to view:
Also, if it is code from an installed and imported Python package:
If it is an Airflow Provider, we already have a "Providers" page to verify those version changes.
If it is not an Airflow Provider, then maybe we can provide a way to view the versions of the packages used by that DAG. Possibly an equivalent of pip freeze but filtered to just the modules imported in the top level of that DAG file.
Option 2: Links to the modules in the code view:
It can also be that the module names in the import lines of the code view be turned into hyperlinks which will take you to viewing the code of that module.
Option 3: Symbols panel like in GitHub:
It would be great if there was a way to implement something like GitHub's symbols panel when viewing a file in GitHub. You click on a symbol in the code view and then it brings up a list of the definitions and you click on the definition and it takes you to that file's code view. This might be a bit tricky unless someone built a software that does this and we can utilize that.
I am starting this discussion to see the thoughts of others on this.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
For anyone that uses a "git sync" method for deploying their DAGs:
Without having to go into your git sync container's logs, it looks like currently the only way to confirm the new DAG changes are deployed is to look for the changes in the "Code" page of your DAG (or if there is changes that would cause a grid change you can verify the change on that page too).
However, what if you are importing a function from a separate file within the same DAG folder and you made changes to that function in that other python file? Currently there is no way to verify those changes are deployed without either simply waiting a few minutes and hoping it has synced or checking the git sync container's logs. Neither are a user-friendly way to verify the code change got deployed.
I am thinking we need a way in Airflow UI to view the code of non-DAG files. There is obviously complexity to this ask so I'll try and break it out like so:
Let's say a DAG uses code from different methods of importing modules for use in DAGs:
PYTHONPATHlike so:PYTHONPATH=/home/arch/projects/custom_package.(following the methods explained in "Modules Management" documentation page: https://airflow.apache.org/docs/apache-airflow/stable/administration-and-deployment/modules_management.html)
and you imported them like so:
Maybe the "Code" page can be expanded to let you view the code of these modules. I am thinking some possible ways:
Option 1: List of imported modules to switch to on the "Code" page:
Show a list of files based on what was imported in the DAG, so you can click on the name and view the code of that file. For the above examples it will be these files to view:
Also, if it is code from an installed and imported Python package:
pip freezebut filtered to just the modules imported in the top level of that DAG file.Option 2: Links to the modules in the code view:
It can also be that the module names in the import lines of the code view be turned into hyperlinks which will take you to viewing the code of that module.
Option 3: Symbols panel like in GitHub:
It would be great if there was a way to implement something like GitHub's symbols panel when viewing a file in GitHub. You click on a symbol in the code view and then it brings up a list of the definitions and you click on the definition and it takes you to that file's code view. This might be a bit tricky unless someone built a software that does this and we can utilize that.
I am starting this discussion to see the thoughts of others on this.
Beta Was this translation helpful? Give feedback.
All reactions