Taragolis commented on code in PR #37202:
URL: https://github.com/apache/airflow/pull/37202#discussion_r1480331153


##########
tests/providers/apprise/hooks/test_apprise.py:
##########
@@ -60,17 +59,17 @@ def test_set_config_from_conn_with_list(self):
         """
         Test set_config_from_conn for list of dict config
         """
-        config = (
-            '[{"path": "http://some_path_that_dont_exist/";, "tag": "p0"},'
-            '{"path": "http://some_other_path_that_dont_exist/";, "tag": "p1"}]'
-        )
+        extra = {"config": {
+            [{"path": "http://some_path_that_dont_exist/";, "tag": "p0"},
+             {"path": "http://some_other_path_that_dont_exist/";, "tag": "p1"}]
+        }}

Review Comment:
   ```suggestion
           extra = {
               "config": [
                   {"path": "http://some_path_that_dont_exist/";, "tag": "p0"},
                   {"path": "http://some_other_path_that_dont_exist/";, "tag": 
"p1"},
               ]
           }
   ```



##########
airflow/providers/apprise/hooks/apprise.py:
##########
@@ -48,7 +48,8 @@ def __init__(self, apprise_conn_id: str = default_conn_name) 
-> None:
 
     def get_config_from_conn(self):
         conn = self.get_connection(self.apprise_conn_id)
-        return json.loads(conn.extra_dejson["config"])
+        config = conn.extra_dejson["config"]
+        return config if isinstance(config, dict) else json.loads(config)

Review Comment:
   Looks like config could be either Dictionary or List of Dictionaries
   
   ```suggestion
           return json.loads(config) if isinstance(config, str) else config
   ```



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