pierrejeambrun commented on code in PR #31358:
URL: https://github.com/apache/airflow/pull/31358#discussion_r1196867852
##########
tests/providers/amazon/aws/operators/test_emr_add_steps.py:
##########
@@ -83,12 +83,14 @@ def test_init(self):
@pytest.mark.parametrize(
"job_flow_id, job_flow_name",
[
- pytest.param("j-8989898989", "test_cluster", id="both-specified"),
pytest.param(None, None, id="both-none"),
],
)
def test_validate_mutually_exclusive_args(self, job_flow_id,
job_flow_name):
- error_message = r"Exactly one of job_flow_id or job_flow_name must be
specified\."
+ error_message = (
Review Comment:
Name of the test is not relevant anymore, we need to adapt.
##########
airflow/providers/amazon/aws/operators/emr.py:
##########
@@ -87,9 +87,14 @@ def __init__(
execution_role_arn: str | None = None,
**kwargs,
):
- if not exactly_one(job_flow_id is None, job_flow_name is None):
- raise AirflowException("Exactly one of job_flow_id or
job_flow_name must be specified.")
+ if (job_flow_id is None) and (job_flow_name is None):
+ raise AirflowException(
+ "Exactly job_flow_id or job_flow_name must be existed. "
Review Comment:
```suggestion
"At least one of job_flow_id or job_flow_name must be
specified. "
```
If both are specified maybe we should log something to warn that something
might not work as expected. (id takes precedence)
--
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]