@@ -95,6 +95,7 @@ def get_db_hook(self) -> BigQueryHook:
95
95
use_legacy_sql = self .use_legacy_sql ,
96
96
location = self .location ,
97
97
impersonation_chain = self .impersonation_chain ,
98
+ labels = self .labels ,
98
99
)
99
100
100
101
@@ -152,12 +153,15 @@ class BigQueryCheckOperator(_BigQueryDbHookMixin, SQLCheckOperator):
152
153
Service Account Token Creator IAM role to the directly preceding identity, with first
153
154
account from the list granting this role to the originating account (templated).
154
155
:type impersonation_chain: Union[str, Sequence[str]]
156
+ :param labels: a dictionary containing labels for the table, passed to BigQuery
157
+ :type labels: dict
155
158
"""
156
159
157
160
template_fields = (
158
161
'sql' ,
159
162
'gcp_conn_id' ,
160
163
'impersonation_chain' ,
164
+ 'labels' ,
161
165
)
162
166
template_ext = ('.sql' ,)
163
167
ui_color = BigQueryUIColors .CHECK .value
@@ -172,6 +176,7 @@ def __init__(
172
176
use_legacy_sql : bool = True ,
173
177
location : Optional [str ] = None ,
174
178
impersonation_chain : Optional [Union [str , Sequence [str ]]] = None ,
179
+ labels : Optional [dict ] = None ,
175
180
** kwargs ,
176
181
) -> None :
177
182
super ().__init__ (sql = sql , ** kwargs )
@@ -184,6 +189,7 @@ def __init__(
184
189
self .use_legacy_sql = use_legacy_sql
185
190
self .location = location
186
191
self .impersonation_chain = impersonation_chain
192
+ self .labels = labels
187
193
188
194
189
195
class BigQueryValueCheckOperator (_BigQueryDbHookMixin , SQLValueCheckOperator ):
@@ -216,13 +222,16 @@ class BigQueryValueCheckOperator(_BigQueryDbHookMixin, SQLValueCheckOperator):
216
222
Service Account Token Creator IAM role to the directly preceding identity, with first
217
223
account from the list granting this role to the originating account (templated).
218
224
:type impersonation_chain: Union[str, Sequence[str]]
225
+ :param labels: a dictionary containing labels for the table, passed to BigQuery
226
+ :type labels: dict
219
227
"""
220
228
221
229
template_fields = (
222
230
'sql' ,
223
231
'gcp_conn_id' ,
224
232
'pass_value' ,
225
233
'impersonation_chain' ,
234
+ 'labels' ,
226
235
)
227
236
template_ext = ('.sql' ,)
228
237
ui_color = BigQueryUIColors .CHECK .value
@@ -239,6 +248,7 @@ def __init__(
239
248
use_legacy_sql : bool = True ,
240
249
location : Optional [str ] = None ,
241
250
impersonation_chain : Optional [Union [str , Sequence [str ]]] = None ,
251
+ labels : Optional [dict ] = None ,
242
252
** kwargs ,
243
253
) -> None :
244
254
super ().__init__ (sql = sql , pass_value = pass_value , tolerance = tolerance , ** kwargs )
@@ -251,6 +261,7 @@ def __init__(
251
261
self .gcp_conn_id = gcp_conn_id
252
262
self .use_legacy_sql = use_legacy_sql
253
263
self .impersonation_chain = impersonation_chain
264
+ self .labels = labels
254
265
255
266
256
267
class BigQueryIntervalCheckOperator (_BigQueryDbHookMixin , SQLIntervalCheckOperator ):
@@ -296,6 +307,8 @@ class BigQueryIntervalCheckOperator(_BigQueryDbHookMixin, SQLIntervalCheckOperat
296
307
Service Account Token Creator IAM role to the directly preceding identity, with first
297
308
account from the list granting this role to the originating account (templated).
298
309
:type impersonation_chain: Union[str, Sequence[str]]
310
+ :param labels: a dictionary containing labels for the table, passed to BigQuery
311
+ :type labels: dict
299
312
"""
300
313
301
314
template_fields = (
@@ -304,6 +317,7 @@ class BigQueryIntervalCheckOperator(_BigQueryDbHookMixin, SQLIntervalCheckOperat
304
317
'sql1' ,
305
318
'sql2' ,
306
319
'impersonation_chain' ,
320
+ 'labels' ,
307
321
)
308
322
ui_color = BigQueryUIColors .CHECK .value
309
323
@@ -320,6 +334,7 @@ def __init__(
320
334
use_legacy_sql : bool = True ,
321
335
location : Optional [str ] = None ,
322
336
impersonation_chain : Optional [Union [str , Sequence [str ]]] = None ,
337
+ labels : Optional [Dict ] = None ,
323
338
** kwargs ,
324
339
) -> None :
325
340
super ().__init__ (
@@ -338,6 +353,7 @@ def __init__(
338
353
self .use_legacy_sql = use_legacy_sql
339
354
self .location = location
340
355
self .impersonation_chain = impersonation_chain
356
+ self .labels = labels
341
357
342
358
343
359
class BigQueryGetDataOperator (BaseOperator ):
0 commit comments