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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to