-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Specify New Parameters #16430
Comments
Thanks for opening your first issue here! Be sure to follow the issue template! |
It's already suported in 2.0 https://airflow.apache.org/docs/apache-airflow/stable/dag-run.html#using-ui |
For the future @paantya, please use GitHub discussions for similar questions, not issues. |
@potiuk As I understand it, this can only be used in the operator template field, but not in python code, passing parameters to models. |
Do you have an example of passing these values as arguments to Python code? |
It's triggering DAG run. Those are parameters for the whole DAG to run. You can use those parameters in your DAG definition to pass them to any underlying operators: |
@potiuk |
I have not found such an example of how to do this, as in Perfect or DVC |
I want to take out all the potentially changeable parameters in the UI so that we can change them if needed. |
The Template for this config is not there, but this is a nice feature to add. If you want to add template - then by all means create a feature request (just make sure you follow the template and describe exactly what you want) , possibly you can submit a PR with that? Airflow is a community-driven project so our users are welcome to make PRs. |
take out = edited to config params |
I will try to arrange it |
@potiuk for PR i need creat new issue "Feature request"? or create https://github.com/apache/airflow/pulls? |
If you want to start on PR, there is no need to create Feature request at all. |
Ah nice! Thankss @msumit TIL |
@paantya maybe you would like to make a change to our documentattion describing it, if it is not clear enough? That would be nice first contribution to Airflow. |
:slowpoke: |
@msumit |
@potiuk as I figure it out, I would gladly add it) |
@potiuk please tell me, but you can display the parameters in .yaml format and not in .json? |
@paantya it should be straightforward to use. Specify params while initiating DAG, for example
& then use it in a task, like this
|
tnx, cool! @msumit Will these parameters need to be passed each in the form of terminal parameters? or can we somehow save them all into a file or transfer them to python? |
my smale config .yaml
|
so far it has come to mind that it will be necessary to specify each parameter in the launch parameters, like params['clustering']['high'] :
& then use it in a task, like this
|
and do the same with all the other parameters .. |
can I somehow save these parameters to a file? |
like
|
@paantya ideally you should be able to read the file in your DAG and create a dict from that & use that as params to the DAG. However, as the DAG data get serialized and stored in DB, so not sure if that breaks something. |
tnx is there a way to pass DAG parameters without explicitly specifying them in the call string? |
Is it possible somehow to save the values passed to params to disk? I can imagine that we can prepare a dictionary for params using a function (not tested yet).
|
@msumit Can you please tell me, is it possible in params to draw the output in the form of yaml, not json? in UI |
When is it planned to support changing in UI the default startup DAG parameters to be used in python code?
something like "perfec"t has:
https://docs.prefect.io/orchestration/tutorial/parameters.html#specify-new-parameters
something like "DVC" has, in the near future:
https://www.youtube.com/watch?v=nXJXR-zBvHQ&t=203s&ab_channel=DVCorg
The text was updated successfully, but these errors were encountered: