Skip to content

Commit

Permalink
fix static checks
Browse files Browse the repository at this point in the history
  • Loading branch information
gopidesupavan committed Jul 24, 2024
1 parent d450367 commit 1740692
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions airflow/providers/amazon/aws/hooks/step_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import json

from airflow.exceptions import AirflowException
from airflow.exceptions import AirflowFailException
from airflow.providers.amazon.aws.hooks.base_aws import AwsBaseHook


Expand Down Expand Up @@ -61,7 +61,7 @@ def start_execution(
"""
if is_redrive_execution:
if not name:
raise AirflowException(
raise AirflowFailException(
"Execution name is required to start RedriveExecution for %s.", state_machine_arn
)
elements = state_machine_arn.split(":stateMachine:")
Expand Down
6 changes: 4 additions & 2 deletions tests/providers/amazon/aws/hooks/test_step_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import pytest
from moto import mock_aws

from airflow.exceptions import AirflowException
from airflow.exceptions import AirflowFailException
from airflow.providers.amazon.aws.hooks.step_function import StepFunctionHook


Expand Down Expand Up @@ -64,7 +64,9 @@ def test_redrive_execution(self, mock_conn):
def test_redrive_execution_without_name_should_fail(self, mock_conn):
mock_conn.redrive_execution.return_value = {"redriveDate": datetime(2024, 1, 1)}

with pytest.raises(AirflowException, match="Execution name is required to start RedriveExecution"):
with pytest.raises(
AirflowFailException, match="Execution name is required to start RedriveExecution"
):
StepFunctionHook().start_execution(
state_machine_arn="arn:aws:states:us-east-1:123456789012:stateMachine:test-state-machine",
is_redrive_execution=True,
Expand Down

0 comments on commit 1740692

Please sign in to comment.