hussein-awala commented on code in PR #33841:
URL: https://github.com/apache/airflow/pull/33841#discussion_r1314021479


##########
tests/serialization/test_serialized_objects.py:
##########
@@ -39,10 +39,9 @@ def test_recursive_serialize_calls_must_forward_kwargs():
 
     class_def = None
     for stmt in ast.walk(tree):
-        if not isinstance(stmt, ast.ClassDef):
-            continue
-        if stmt.name == "BaseSerialization":
-            class_def = stmt
+        if isinstance(stmt, ast.ClassDef):
+            if stmt.name == "BaseSerialization":
+                class_def = stmt

Review Comment:
   same here



##########
tests/always/test_project_structure.py:
##########
@@ -147,12 +147,9 @@ def get_classes_from_file(self, filepath: str):
         module = filepath_to_module(filepath)
         results: dict = {}
         for current_node in ast.walk(doc_node):
-            if not isinstance(current_node, ast.ClassDef):
-                continue
-            name = current_node.name
-            if not name.endswith(tuple(self.CLASS_SUFFIXES)):
-                continue
-            results[f"{module}.{name}"] = current_node
+            if isinstance(current_node, ast.ClassDef):
+                if current_node.name.endswith(tuple(self.CLASS_SUFFIXES)):
+                    results[f"{module}.{current_node.name}"] = current_node

Review Comment:
   For readability, could you replace inner if by `and` operator?



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