Skip to content

Commit

Permalink
Remove unnecessary method based on @edgga's comment on d70e6d7 and PR #…
Browse files Browse the repository at this point in the history
  • Loading branch information
tatiana committed Sep 27, 2023
1 parent 6a09ce8 commit 220bec1
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions cosmos/operators/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,19 +459,6 @@ def __init__(
self.base_cmd = ["test"]
self.on_warning_callback = on_warning_callback

def _should_run_tests(
self,
result: FullOutputSubprocessResult,
no_tests_message: str = "Nothing to do",
) -> bool:
"""
Check if any tests are defined to run in the DAG. If tests are defined
and on_warning_callback is set, then function returns True.
:param result: The output from the build and run command.
"""
return self.on_warning_callback is not None and no_tests_message not in result.output

def _handle_warnings(self, result: FullOutputSubprocessResult, context: Context) -> None:
"""
Handles warnings by extracting log issues, creating additional context, and calling the
Expand All @@ -491,7 +478,7 @@ def _handle_warnings(self, result: FullOutputSubprocessResult, context: Context)

def execute(self, context: Context) -> None:
result = self.build_and_run_cmd(context=context)
if self._should_run_tests(result):
if self.on_warning_callback:
warnings = parse_output(result, "WARN")
if warnings > 0:
self._handle_warnings(result, context)
Expand Down

0 comments on commit 220bec1

Please sign in to comment.