uranusjr commented on a change in pull request #17651:
URL: https://github.com/apache/airflow/pull/17651#discussion_r723788007
##########
File path: tests/test_utils/logging_command_executor.py
##########
@@ -62,5 +62,39 @@ def check_output(self, cmd):
return output
+class CMDExecutor(LoggingCommandExecutor):
Review comment:
I think we should spell out *Command* instead; there's no advantage to
save the four characters. Same goes for other additions.
##########
File path: airflow/exceptions.py
##########
@@ -261,3 +261,7 @@ def __repr__(self) -> str:
class TaskDeferralError(AirflowException):
"""Raised when a task failed during deferral for some reason."""
+
+
+class CMDExecutionError(AirflowException):
+ """Raise in case of error during cmd execution"""
Review comment:
Since this exception is only ever raised in tests, it should not live in
the main Airflow code base.
##########
File path: tests/test_utils/gcp_system_helpers.py
##########
@@ -123,6 +123,11 @@ def provide_gcs_bucket(bucket_name: str):
@pytest.mark.system("google")
class GoogleSystemTest(SystemTest):
+ @staticmethod
+ def execute_cmd(*args, **kwargs):
+ executor = CMDExecutor()
+ return executor.execute_cmd(*args, **kwargs)
Review comment:
What's the need of this new function if it's only used once? What's
wrong with instantiating the executor inline (like in the old code)?
--
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]