Skip to content

Fix output for airflow providers get command#30978

Merged
potiuk merged 1 commit intoapache:mainfrom
astronomer:fix_provider_get_cmd
May 1, 2023
Merged

Fix output for airflow providers get command#30978
potiuk merged 1 commit intoapache:mainfrom
astronomer:fix_provider_get_cmd

Conversation

@pankajastro
Copy link
Copy Markdown
Member

If I use the airflow provider get <provider-name> -o json/yaml CLI command it does not respect -o option. It works perfectly fine when I pass the --full option also in the above command. The issue is currently if the --full option is not provided we use standard statement print to print results and not the custom AirflowConsole. In this PR I'm replacing print with AirflowConsole().print_as
Before
Screenshot 2023-05-01 at 3 07 15 AM

After
Screenshot 2023-05-01 at 3 03 27 AM


^ Add meaningful description above

Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@pankajastro pankajastro changed the title Fix airflow providers get command output Fix output for airflow providers get command Apr 30, 2023
If I use the `airflow provider get <provider-name> -o json/yaml` CLI command
it does not respect `-o` option.
It works perfectly fine when I pass the `--full` option also in the above command.
The issue is currently if the `--full` option is not provided we
use standard statement print to print results and not the custom AirflowConsole.
In this PR I'm replacing print with `AirflowConsole().print_as`
@pankajastro pankajastro force-pushed the fix_provider_get_cmd branch from 2c602b5 to e13510d Compare May 1, 2023 06:58
@pankajastro pankajastro marked this pull request as ready for review May 1, 2023 07:30
@potiuk
Copy link
Copy Markdown
Member

potiuk commented May 1, 2023

NIce!

@potiuk potiuk merged commit 23b5b31 into apache:main May 1, 2023
@pankajastro pankajastro deleted the fix_provider_get_cmd branch May 1, 2023 16:09
@ephraimbuddy ephraimbuddy added this to the Airflow 2.6.1 milestone May 8, 2023
@ephraimbuddy ephraimbuddy added the type:bug-fix Changelog: Bug Fixes label May 8, 2023
ephraimbuddy pushed a commit that referenced this pull request May 8, 2023
If I use the `airflow provider get <provider-name> -o json/yaml` CLI command
it does not respect `-o` option.
It works perfectly fine when I pass the `--full` option also in the above command.
The issue is currently if the `--full` option is not provided we
use standard statement print to print results and not the custom AirflowConsole.
In this PR I'm replacing print with `AirflowConsole().print_as`

(cherry picked from commit 23b5b31)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:CLI type:bug-fix Changelog: Bug Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants