potiuk commented on code in PR #37458:
URL: https://github.com/apache/airflow/pull/37458#discussion_r1498408740


##########
airflow/providers/yandex/hooks/http_client.py:
##########
@@ -0,0 +1,321 @@
+# 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.
+
+# This file is a copy of 
https://github.com/ydb-platform/ydb/tree/284b7efb67edcdade0b12c849b7fad40739ad62b/ydb/core/fq/libs/http_api_client
+# It is highly recommended to modify original file first in YDB project and 
merge it here afterwards

Review Comment:
   If this is just the one file, I am not too concerned for licence and 
copying. These are merely wrappers around a few calls. 
   
   However,  that calls even more for a set of tests there. It would be enough 
to have a set of test cases where the client is mocked (as we do in many other 
hooks. This has the nice feature as well that it protects against accidental 
regressions. if this code is copied from elsewhere, having independent set of 
hook tests that a) mock client calls b) simulate what the operator does - is 
ratther benefitial to prevent problems, imagine for example the code that got 
copied will have a method renamed but you forget to update the operator. If you 
have a set of Hook unit tests that call all the methods - it wil be cautght 
there (of course MyPy and linters might catch it as well but this is not always 
possible). 



-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to