Skip to content
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

CLI: Variables set should allow to set description #34756

Closed
1 task done
eladkal opened this issue Oct 4, 2023 · 6 comments · Fixed by #34791
Closed
1 task done

CLI: Variables set should allow to set description #34756

eladkal opened this issue Oct 4, 2023 · 6 comments · Fixed by #34791

Comments

@eladkal
Copy link
Contributor

eladkal commented Oct 4, 2023

Body

The CLI:

airflow variables set [-h] [-j] [-v] key VALUE

https://airflow.apache.org/docs/apache-airflow/stable/cli-and-env-variables-ref.html#set_repeat1

Doesn't support adding description though column exists and we support it from Rest API:
https://airflow.apache.org/docs/apache-airflow/stable/stable-rest-api-ref.html#operation/post_variables

The Task:

Allow to set description from cli command

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.
@Zhenye-Na
Copy link
Contributor

Hi @eladkal ,

I am willing to take this issue and make a PR for this.

Before I made any changes, I think this issue is related to this code snippet

@cli_utils.action_cli
@providers_configuration_loaded
def variables_set(args):
"""Create new variable with a given name and value."""
Variable.set(args.key, args.value, serialize_json=args.json)
print(f"Variable {args.key} created")

In order to achieve this, I will need to update the following line

Variable.set(args.key, args.value, serialize_json=args.json)

to something like this:

Variable.set(args.key, args.value, args.description, serialize_json=args.json)

I am wondering if this approach looks good to you and please feel free to assign me to this issue.

Thanks!

@eladkal
Copy link
Contributor Author

eladkal commented Oct 5, 2023

seems right.
you should be able to test it with breeze https://github.com/apache/airflow/blob/main/CONTRIBUTORS_QUICK_START.rst#id11

@starkhushi
Copy link

i wanted to solve this isuue .please assign me to solve

@Zhenye-Na
Copy link
Contributor

seems right. you should be able to test it with breeze https://github.com/apache/airflow/blob/main/CONTRIBUTORS_QUICK_START.rst#id11

Cool, let me do it real quick

@Zhenye-Na
Copy link
Contributor

#34791 is ready for review

@Zhenye-Na
Copy link
Contributor

#34791 is waiting for another approval, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants