[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:
Родитель
b516183d68
Коммит
fb93df142b
|
@ -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()
|
||||
|
|
Загрузка…
Ссылка в новой задаче