You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "dirrao (via GitHub)" <gi...@apache.org> on 2024/05/30 02:56:34 UTC

[PR] Resolve weaviate deprecations in tests [airflow]

dirrao opened a new pull request, #39928:
URL: https://github.com/apache/airflow/pull/39928

   Resolve weaviate deprecations in tests
   related: #38642


-- 
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-unsubscribe@airflow.apache.org

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


Re: [PR] Resolve weaviate deprecations in tests [airflow]

Posted by "eladkal (via GitHub)" <gi...@apache.org>.
eladkal merged PR #39928:
URL: https://github.com/apache/airflow/pull/39928


-- 
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-unsubscribe@airflow.apache.org

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


Re: [PR] Resolve weaviate deprecations in tests [airflow]

Posted by "Taragolis (via GitHub)" <gi...@apache.org>.
Taragolis commented on code in PR #39928:
URL: https://github.com/apache/airflow/pull/39928#discussion_r1620654175


##########
tests/providers/weaviate/operators/test_weaviate.py:
##########
@@ -33,12 +34,16 @@
 class TestWeaviateIngestOperator:
     @pytest.fixture
     def operator(self):
-        return WeaviateIngestOperator(
-            task_id="weaviate_task",
-            conn_id="weaviate_conn",
-            class_name="my_class",
-            input_json=[{"data": "sample_data"}],
-        )
+        with pytest.warns(
+            AirflowProviderDeprecationWarning,
+            match="Passing 'input_json' to WeaviateIngestOperator is deprecated and you should use 'input_data' instead",
+        ):
+            return WeaviateIngestOperator(
+                task_id="weaviate_task",
+                conn_id="weaviate_conn",
+                class_name="my_class",
+                input_json=[{"data": "sample_data"}],
+            )

Review Comment:
   This functional is deprecated that means that no need to provide this in operator in every test which required this fixture, so better rewrite this fixture to avoid to use deprecated functional in regular testing.
   
   We still want to test deprecated functional anyway, so we need to create separate test case(s) where we test only deprecated stuff



-- 
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-unsubscribe@airflow.apache.org

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


Re: [PR] Resolve weaviate deprecations in tests [airflow]

Posted by "dirrao (via GitHub)" <gi...@apache.org>.
dirrao commented on code in PR #39928:
URL: https://github.com/apache/airflow/pull/39928#discussion_r1621014856


##########
tests/providers/weaviate/operators/test_weaviate.py:
##########
@@ -33,12 +34,16 @@
 class TestWeaviateIngestOperator:
     @pytest.fixture
     def operator(self):
-        return WeaviateIngestOperator(
-            task_id="weaviate_task",
-            conn_id="weaviate_conn",
-            class_name="my_class",
-            input_json=[{"data": "sample_data"}],
-        )
+        with pytest.warns(
+            AirflowProviderDeprecationWarning,
+            match="Passing 'input_json' to WeaviateIngestOperator is deprecated and you should use 'input_data' instead",
+        ):
+            return WeaviateIngestOperator(
+                task_id="weaviate_task",
+                conn_id="weaviate_conn",
+                class_name="my_class",
+                input_json=[{"data": "sample_data"}],
+            )

Review Comment:
   Thanks. I have updated as per your 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: commits-unsubscribe@airflow.apache.org

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