[AIRFLOW-3495] Validate one of query and query_uri passed to DataProcSparkSqlOperator (#5510)

DataProcSparkSqlOperator and DataProcHiveOperator are working either with query
or query_uri. Passing both doesn't make sense so check at construction time.
This commit is contained in:
eladkal 2019-07-11 15:52:46 +03:00 коммит произвёл Ash Berlin-Taylor
Родитель b516183d68
Коммит fb93df142b
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -808,6 +808,8 @@ class DataProcHiveOperator(DataProcJobBaseOperator):
self.query = query
self.query_uri = query_uri
self.variables = variables
if self.query is not None and self.query_uri is not None:
raise AirflowException('Only one of `query` and `query_uri` can be passed.')
def execute(self, context):
self.create_job_template()
@ -850,6 +852,8 @@ class DataProcSparkSqlOperator(DataProcJobBaseOperator):
self.query = query
self.query_uri = query_uri
self.variables = variables
if self.query is not None and self.query_uri is not None:
raise AirflowException('Only one of `query` and `query_uri` can be passed.')
def execute(self, context):
self.create_job_template()