dstandish commented on code in PR #25980:
URL: https://github.com/apache/airflow/pull/25980#discussion_r956597599


##########
docs/apache-airflow-providers-amazon/logging/s3-task-handler.rst:
##########
@@ -37,13 +37,16 @@ To enable this feature, ``airflow.cfg`` must be configured 
as follows:
     # id that provides access to the storage location.
     remote_logging = True
     remote_base_log_folder = s3://my-bucket/path/to/logs
-    remote_log_conn_id = MyS3Conn
+    remote_log_conn_id = aws_s3_conn
     # Use server-side encryption for logs stored in S3
     encrypt_s3_logs = False
 
-In the above example, Airflow will try to use ``S3Hook('MyS3Conn')``.
+In the above example, Airflow will try to use 
``S3Hook(aws_conn_id='aws_s3_conn')``.
+
+Local test s3 remote logging
+''''''''''''''''''''''''''''
 
 You can also use `LocalStack <https://localstack.cloud/>`_ to emulate Amazon 
S3 locally.
 To configure it, you must additionally set the endpoint url to point to your 
local stack.
-You can do this via the Connection Extra ``host`` field.
-For example, ``{"host": "http://localstack:4572"}``
+You can do this via the Connection Extra ``endpoint_url`` field.
+For example, ``{"endpoint_url": "http://localstack:4572"}``

Review Comment:
   i see... it was already deprecated... no prob, thanks



##########
airflow/providers/amazon/aws/utils/connection_wrapper.py:
##########
@@ -137,11 +137,22 @@ def __post_init__(self, conn: "Connection"):
         self.extra_config = deepcopy(conn.extra_dejson)
 
         if self.conn_type != "aws":
-            warnings.warn(
-                f"{self.conn_repr} expected connection type 'aws', got 
{self.conn_type!r}.",
-                UserWarning,
-                stacklevel=2,
-            )
+            if self.conn_type.lower() == "s3":
+                warnings.warn(
+                    f"{self.conn_repr}: use 's3' connection type instead of 
'aws' "
+                    "is deprecated and will be removed in a future releases. "
+                    "Please switch to Amazon Web Services Connection type.",

Review Comment:
   ```suggestion
                       f"{self.conn_repr}: Connection type 's3' is deprecated. "
                       "Please update your connection and set 
`conn_type='aws'`.",
   ```



##########
tests/providers/amazon/aws/utils/test_connection_wrapper.py:
##########
@@ -77,13 +77,24 @@ def test_expected_aws_connection_type(self, conn_type):
         wrap_conn = 
AwsConnectionWrapper(conn=mock_connection_factory(conn_type=conn_type))
         assert wrap_conn.conn_type == "aws"
 
-    @pytest.mark.parametrize("conn_type", ["AWS", "boto3", "s3", "emr", 
"google", "google-cloud-platform"])
+    @pytest.mark.parametrize("conn_type", ["AWS", "boto3", "emr", "google", 
"google-cloud-platform"])
     def test_unexpected_aws_connection_type(self, conn_type):
         warning_message = f"expected connection type 'aws', got '{conn_type}'"
         with pytest.warns(UserWarning, match=warning_message):
             wrap_conn = 
AwsConnectionWrapper(conn=mock_connection_factory(conn_type=conn_type))
             assert wrap_conn.conn_type == conn_type
 
+    @pytest.mark.parametrize("conn_type", ["s3", "S3"])
+    def test_deprecated_s3_connection_type(self, conn_type):
+        warning_message = (
+            r"use 's3' connection type instead of 'aws' "
+            r"is deprecated and will be removed in a future releases\. "
+            r"Please switch to Amazon Web Services Connection type\."
+        )

Review Comment:
   ```suggestion
           warning_message = (
               "Connection type 's3' is deprecated. Please update your 
connection and set `conn_type='aws'`."
           )
   ```



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