bugraoz93 commented on code in PR #48837:
URL: https://github.com/apache/airflow/pull/48837#discussion_r2029912711


##########
airflow-ctl/src/airflowctl/ctl/commands/provider_commands.py:
##########
@@ -0,0 +1,39 @@
+#
+# 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.
+from __future__ import annotations
+
+import sys
+
+import rich
+
+from airflowctl.api.client import get_client
+
+
+def list(args) -> None:

Review Comment:
   ```suggestion
   @provide_api_client
   def list(args, cli_api_client) -> None:
   ```
   
   
https://github.com/apache/airflow/blob/319ad7207c143c61b05f8ef8a1772c633671f6d7/airflow-ctl/src/airflowctl/api/client.py#L241
   
   This is a decorator you can directly mount where you don't need to check any 
credentials or client, etc... :)



##########
airflow-ctl/src/airflowctl/ctl/commands/provider_commands.py:
##########
@@ -0,0 +1,39 @@
+#
+# 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.
+from __future__ import annotations
+
+import sys
+
+import rich
+
+from airflowctl.api.client import get_client
+
+
+def list(args) -> None:

Review Comment:
   Also, we don't need to implement any command which have a operation. Simple 
ones like the `list` `get` `created` for all group commands. Others still need 
implementation if needed.
   
   See this one. I will merge later this night. It is ready and working :)
   
   https://github.com/apache/airflow/pull/48146



##########
airflow-ctl/src/airflowctl/api/client.py:
##########
@@ -145,7 +145,7 @@ class Client(httpx.Client):
 
     def __init__(self, *, base_url: str, token: str, **kwargs: Any):
         auth = BearerAuth(token)
-        kwargs["base_url"] = f"{base_url}/public"
+        kwargs["base_url"] = f"{base_url}"

Review Comment:
   ```suggestion
           kwargs["base_url"] = f"{base_url}/api/v2"
   ```
   
   I made this change in the other PR I limked in the below comment 



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