kaxil commented on a change in pull request #7014: [AIRFLOW-XXXX] Add `airflow 
dags show` command guide
URL: https://github.com/apache/airflow/pull/7014#discussion_r362820001
 
 

 ##########
 File path: docs/usage-cli.rst
 ##########
 @@ -68,3 +68,94 @@ If you’re using ``zsh``, add the following to your 
``.zshrc``:
   autoload bashcompinit
   bashcompinit
   eval "$(register-python-argcomplete airflow)"
+
+Exporting DAGs to images
+------------------------
+
+The application has the functionality of saving DAG to image file. You can 
attach them to the documentation
+or share with other people without having to send the DAG file and need to 
install the application.
+However, you need to have `Graphviz <https://graphviz.gitlab.io/download/>`_ 
installed to generate it.
+
+For example, if you want to export ``example_gcp_datacatalog`` DAG then you 
can use the following command:
+
+.. code-block:: bash
+
+  airflow dag show example_gcp_datacatalog
+
+After passing the ``dag_id`` parameter, the command will print DAG to the 
screen in the DOT format.
+
+It is possible to save the file in a different format. To do this, add the 
switch ``--save [filename].[format]``.
+If you want to save files as PNG, you can use the following command:
+
+.. code-block:: bash
+
+  airflow dags show example_gcp_datacatalog --save example_gcp_datacatalog.png
+
+An example image file may look as follow:
+
+.. figure:: img/usage_cli_export.png
+    :width: 100%
+
+    Example DAG representation
+
+The following file formats are supported:
+
+ * ``bmp``,
+ * ``canon``, ``dot``, ``gv``, ``xdot``, ``xdot1.2``, ``xdot1.4``,
+ * ``cgimage``,
+ * ``cmap``,
+ * ``eps``,
+ * ``exr``,
+ * ``fig``,
+ * ``gd``, ``gd2``,
+ * ``gif``,
+ * ``gtk``,
+ * ``ico``,
+ * ``imap``, ``cmapx``,
+ * ``imap_np``, ``cmapx_np``,
+ * ``ismap``,
+ * ``jp2``,
+ * ``jpg``, ``jpeg``, ``jpe``,
+ * ``json``, ``json0``, ``dot_json``, ``xdot_json``,
+ * ``pct``, ``pict``,
+ * ``pdf``,
+ * ``pic``,
+ * ``plain``, ``plain-ext``,
+ * ``png``,
+ * ``pov``,
+ * ``ps``,
+ * ``ps2``,
+ * ``psd``,
+ * ``sgi``,
+ * ``svg``, ``svgz``,
+ * ``tga``,
+ * ``tif``, ``tiff``,
+ * ``tk``,
+ * ``vml``, ``vmlz``,
+ * ``vrml``,
+ * ``wbmp``,
+ * ``webp``,
+ * ``xlib``,
+ * ``x11``.
+
+Display DAGs
+------------
+
+Sometimes you will work on DAGs that contain complex dependencies. It is 
helpful then to preview
+the DAG to see if it is correct.
+
+If you have macOS with `Graphviz <https://graphviz.gitlab.io/download/>`_  and 
`iTerm2 <https://iterm2.com/>`__
 
 Review comment:
   It will work for normal Terminal app as well, isn't it? Or does it only work 
on iTerm2?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to