yuseok89 commented on code in PR #68854:
URL: https://github.com/apache/airflow/pull/68854#discussion_r4290293261


##########
airflow-ctl/src/airflowctl/ctl/commands/provider_command.py:
##########
@@ -0,0 +1,37 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+"""Command functions for installed Airflow providers."""
+
+from __future__ import annotations
+
+from typing import Any
+
+from airflowctl.api.client import NEW_API_CLIENT, Client, ClientKind, 
provide_api_client
+from airflowctl.ctl.console_formatting import AirflowConsole
+
+
+@provide_api_client(kind=ClientKind.CLI)
+def get_provider(args, api_client: Client = NEW_API_CLIENT) -> dict[str, Any]:
+    """Get information for an installed provider."""
+    response = api_client.providers.get(provider_name=args.provider_name)
+    if args.full:
+        result = response.provider_info.model_dump(by_alias=True, 
exclude_none=True)

Review Comment:
   I noticed that `--full` returns only the provider name for SendGrid, whereas 
the existing command also includes the package name, description, email backend 
and documentation URL.
   
   With `airflow providers get apache-airflow-providers-sendgrid --full -o 
json`, the output is
   
   ```
   [
     {
       "package-name": "apache-airflow-providers-sendgrid",
       "name": "Sendgrid",
       "description": "Sendgrid https://sendgrid.com/";,
       "email-backends": [
         "airflow.providers.sendgrid.utils.emailer.send_email"
       ],
       "documentation-url": 
"https://airflow.apache.org/docs/apache-airflow-providers-sendgrid/4.2.5";
     }
   ]
   ```
   
   Using the same installed provider data with this PR's API and `get_provider` 
implementation produces
   
   ```
   [{"name": "Sendgrid"}]
   ```
   
   Is this reduction in the information available through `--full` acceptable 
when moving from `airflow providers get` to `airflowctl`?



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to