You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/02/28 22:46:05 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #21731: Store callbacks in database if standalone_dag_processor config is True.

uranusjr commented on a change in pull request #21731:
URL: https://github.com/apache/airflow/pull/21731#discussion_r816309030



##########
File path: airflow/callbacks/callback_requests.py
##########
@@ -41,6 +42,14 @@ def __eq__(self, other):
     def __repr__(self):
         return str(self.__dict__)
 
+    def to_json(self) -> str:
+        return json.dumps(self.__dict__)
+
+    @classmethod
+    def from_json(cls, json_str: str):
+        json_object = json.loads(json_str)
+        return cls(full_filepath=json_object["full_filepath"], msg=json_object["msg"])

Review comment:
       ```suggestion
           return cls(**json_object)
   ```




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