-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve documentation on Params
#20567
Conversation
Then You will also see result of building the docs here in CI . More info here: https://github.com/apache/airflow/blob/main/docs/README.rst |
That looks good to me but you need to fix static checks and docs builds . For static checks |
Static check failure looks unrelated, but the doc failure is related. Do rebase on main and build docs again |
|
||
.. code-block:: | ||
:caption a simple DAG with a parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:caption a simple DAG with a parameter | |
:caption: a simple DAG with a parameter |
Check: https://www.sphinx-doc.org/en/1.4.9/markup/code.html#caption-and-name
If there's already a dag param with that name, the task-level default will take precedence over the dag-level default. | ||
|
||
.. code-block:: | ||
:caption tasks can have parameters too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
If templates aren't your style, you can access params in via the context. | ||
|
||
.. code-block:: | ||
:caption use the context kwarg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
e902022
to
8c6e990
Compare
Thanks for the tips @potiuk When I do that (on Ubuntu 20.04, in a fresh venv) I get some errors:
After which I can run the server, but I see a 404 error when I navigate here http://localhost:8000/docs/apache-airflow/latest/index.html It seems to work OK on my Macbook though, so I'll just use that for now (though I'm happy to help toubleshoot the above error if you'd like, I'm just not sure where to start). |
When I do that (on Ubuntu 20.04, in a fresh venv) I get some errors: Did you run this?
If so - make sure to pull&build the image when asked. |
I don't know how I overlooked that prompt (several times). It's working now, thanks. |
I think I should've made this a draft PR until I was ready. Sorry about the extra noise. Anyhow, I think that it is now actually ready for a review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, well done @MatrixManAtYrService 🎉
The PR is likely ready to be merged. No tests are needed as no important environment files, nor python files were modified by it. However, committers might decide that full test matrix is needed and add the 'full tests needed' label. Then you should rebase it to the latest main or amend the last commit of the PR, and push it with --force-with-lease. |
I think that this doc could be improved by adding examples of how to reference the params in your dag. (Also, the current example code causes this: #20559.) While trying to find the right place to work a few reference examples in, I ended up rewriting quite a lot of it. Let me know if you think that this is an improvement. I haven't yet figured out how to build this and view it locally, and I'd want to do that as a sanity check before merging it, but I figured get feedback on what I've written before I do that. (cherry picked from commit 064efbe)
I think that this doc could be improved by adding examples of how to reference the params in your dag. (Also, the current example code causes this: #20559.) While trying to find the right place to work a few reference examples in, I ended up rewriting quite a lot of it. Let me know if you think that this is an improvement. I haven't yet figured out how to build this and view it locally, and I'd want to do that as a sanity check before merging it, but I figured get feedback on what I've written before I do that. (cherry picked from commit 064efbe)
I think that this doc could be improved by adding examples of how to reference the params in your dag. (Also, the current example code causes this: #20559.)
While trying to find the right place to work a few reference examples in, I ended up rewriting quite a lot of it.
Let me know if you think that this is an improvement.
I haven't yet figured out how to build this and view it locally, and I'd want to do that as a sanity check before merging it, but I figured get feedback on what I've written before I do that.