turbaszek commented on a change in pull request #12698:
URL: https://github.com/apache/airflow/pull/12698#discussion_r532191545
##########
File path: airflow/cli/commands/provider_command.py
##########
@@ -40,17 +43,20 @@ def _tabulate_providers(providers: List[Dict], tablefmt:
str):
return tabulate(tabulate_data, tablefmt=tablefmt, headers='keys')
+def _remove_rst_syntax(value: str) -> str:
+ return re.sub("[`_<>]", "", value.strip(" \n."))
+
+
def provider_get(args):
"""Get a provider info."""
providers = ProvidersManager().providers
if args.provider_name in providers:
provider_version = providers[args.provider_name][0]
provider_info = providers[args.provider_name][1]
- print("#")
- print(f"# Provider: {args.provider_name}")
- print(f"# Version: {provider_version}")
- print("#")
+ print(f"Provider: {args.provider_name}")
+ print(f"Version: {provider_version}")
if args.full:
+ provider_info["description"] =
_remove_rst_syntax(provider_info["description"])
Review comment:
I would say that if `args.full` is passed we should not print the first
two lines - just output the yaml / json, this will allow users to use it in
`jq` for example
----------------------------------------------------------------
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]