apache-airflow-providers-google 9.0.0rc2__py3-none-any.whl → 10.0.0rc1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. airflow/providers/google/cloud/hooks/automl.py +5 -6
  2. airflow/providers/google/cloud/hooks/bigquery.py +5 -6
  3. airflow/providers/google/cloud/hooks/bigquery_dts.py +11 -8
  4. airflow/providers/google/cloud/hooks/bigtable.py +5 -6
  5. airflow/providers/google/cloud/hooks/cloud_build.py +14 -11
  6. airflow/providers/google/cloud/hooks/cloud_composer.py +16 -0
  7. airflow/providers/google/cloud/hooks/cloud_memorystore.py +5 -14
  8. airflow/providers/google/cloud/hooks/cloud_sql.py +5 -7
  9. airflow/providers/google/cloud/hooks/cloud_storage_transfer_service.py +5 -5
  10. airflow/providers/google/cloud/hooks/compute.py +5 -6
  11. airflow/providers/google/cloud/hooks/compute_ssh.py +8 -12
  12. airflow/providers/google/cloud/hooks/datacatalog.py +5 -9
  13. airflow/providers/google/cloud/hooks/dataflow.py +14 -6
  14. airflow/providers/google/cloud/hooks/dataform.py +8 -0
  15. airflow/providers/google/cloud/hooks/datafusion.py +13 -6
  16. airflow/providers/google/cloud/hooks/dataplex.py +5 -8
  17. airflow/providers/google/cloud/hooks/dataproc.py +13 -8
  18. airflow/providers/google/cloud/hooks/dataproc_metastore.py +8 -0
  19. airflow/providers/google/cloud/hooks/datastore.py +5 -6
  20. airflow/providers/google/cloud/hooks/dlp.py +5 -9
  21. airflow/providers/google/cloud/hooks/functions.py +5 -6
  22. airflow/providers/google/cloud/hooks/gcs.py +6 -6
  23. airflow/providers/google/cloud/hooks/gdm.py +5 -6
  24. airflow/providers/google/cloud/hooks/kms.py +5 -9
  25. airflow/providers/google/cloud/hooks/kubernetes_engine.py +6 -4
  26. airflow/providers/google/cloud/hooks/life_sciences.py +5 -9
  27. airflow/providers/google/cloud/hooks/mlengine.py +8 -0
  28. airflow/providers/google/cloud/hooks/natural_language.py +5 -9
  29. airflow/providers/google/cloud/hooks/os_login.py +5 -6
  30. airflow/providers/google/cloud/hooks/pubsub.py +5 -5
  31. airflow/providers/google/cloud/hooks/secret_manager.py +5 -9
  32. airflow/providers/google/cloud/hooks/spanner.py +5 -6
  33. airflow/providers/google/cloud/hooks/speech_to_text.py +5 -9
  34. airflow/providers/google/cloud/hooks/stackdriver.py +5 -6
  35. airflow/providers/google/cloud/hooks/tasks.py +5 -9
  36. airflow/providers/google/cloud/hooks/text_to_speech.py +5 -9
  37. airflow/providers/google/cloud/hooks/translate.py +5 -6
  38. airflow/providers/google/cloud/hooks/vertex_ai/auto_ml.py +5 -5
  39. airflow/providers/google/cloud/hooks/vertex_ai/batch_prediction_job.py +5 -6
  40. airflow/providers/google/cloud/hooks/vertex_ai/custom_job.py +5 -6
  41. airflow/providers/google/cloud/hooks/vertex_ai/dataset.py +8 -0
  42. airflow/providers/google/cloud/hooks/vertex_ai/endpoint_service.py +8 -0
  43. airflow/providers/google/cloud/hooks/vertex_ai/hyperparameter_tuning_job.py +5 -6
  44. airflow/providers/google/cloud/hooks/vertex_ai/model_service.py +8 -0
  45. airflow/providers/google/cloud/hooks/video_intelligence.py +5 -9
  46. airflow/providers/google/cloud/hooks/vision.py +5 -6
  47. airflow/providers/google/cloud/hooks/workflows.py +8 -0
  48. airflow/providers/google/cloud/operators/bigquery.py +1 -148
  49. airflow/providers/google/cloud/operators/cloud_build.py +0 -13
  50. airflow/providers/google/cloud/operators/cloud_composer.py +2 -68
  51. airflow/providers/google/cloud/operators/cloud_storage_transfer_service.py +0 -21
  52. airflow/providers/google/cloud/operators/dataflow.py +2 -72
  53. airflow/providers/google/cloud/operators/dataform.py +5 -141
  54. airflow/providers/google/cloud/operators/datafusion.py +0 -102
  55. airflow/providers/google/cloud/operators/dataplex.py +3 -61
  56. airflow/providers/google/cloud/operators/dataproc.py +5 -13
  57. airflow/providers/google/cloud/operators/datastore.py +2 -86
  58. airflow/providers/google/cloud/operators/gcs.py +1 -43
  59. airflow/providers/google/cloud/operators/mlengine.py +1 -123
  60. airflow/providers/google/cloud/operators/pubsub.py +0 -61
  61. airflow/providers/google/cloud/operators/stackdriver.py +0 -101
  62. airflow/providers/google/cloud/operators/vertex_ai/auto_ml.py +0 -26
  63. airflow/providers/google/cloud/operators/vertex_ai/batch_prediction_job.py +0 -41
  64. airflow/providers/google/cloud/operators/vertex_ai/custom_job.py +0 -39
  65. airflow/providers/google/cloud/operators/vertex_ai/dataset.py +0 -71
  66. airflow/providers/google/cloud/operators/vertex_ai/endpoint_service.py +0 -71
  67. airflow/providers/google/cloud/operators/vertex_ai/hyperparameter_tuning_job.py +0 -35
  68. airflow/providers/google/cloud/operators/vertex_ai/model_service.py +0 -41
  69. airflow/providers/google/cloud/sensors/bigquery.py +0 -24
  70. airflow/providers/google/cloud/sensors/cloud_composer.py +0 -10
  71. airflow/providers/google/cloud/sensors/dataflow.py +0 -42
  72. airflow/providers/google/cloud/sensors/dataform.py +0 -12
  73. airflow/providers/google/cloud/sensors/datafusion.py +0 -11
  74. airflow/providers/google/cloud/sensors/dataplex.py +0 -10
  75. airflow/providers/google/cloud/sensors/gcs.py +0 -44
  76. airflow/providers/google/cloud/sensors/pubsub.py +0 -11
  77. airflow/providers/google/cloud/transfers/adls_to_gcs.py +0 -12
  78. airflow/providers/google/cloud/transfers/azure_fileshare_to_gcs.py +0 -12
  79. airflow/providers/google/cloud/transfers/bigquery_to_bigquery.py +0 -10
  80. airflow/providers/google/cloud/transfers/bigquery_to_gcs.py +0 -11
  81. airflow/providers/google/cloud/transfers/bigquery_to_mssql.py +0 -11
  82. airflow/providers/google/cloud/transfers/bigquery_to_mysql.py +0 -11
  83. airflow/providers/google/cloud/transfers/calendar_to_gcs.py +0 -12
  84. airflow/providers/google/cloud/transfers/cassandra_to_gcs.py +0 -11
  85. airflow/providers/google/cloud/transfers/gcs_to_bigquery.py +0 -13
  86. airflow/providers/google/cloud/transfers/gcs_to_gcs.py +0 -11
  87. airflow/providers/google/cloud/transfers/gcs_to_local.py +0 -11
  88. airflow/providers/google/cloud/transfers/gcs_to_sftp.py +0 -11
  89. airflow/providers/google/cloud/transfers/gdrive_to_gcs.py +0 -12
  90. airflow/providers/google/cloud/transfers/gdrive_to_local.py +0 -11
  91. airflow/providers/google/cloud/transfers/local_to_gcs.py +0 -9
  92. airflow/providers/google/cloud/transfers/s3_to_gcs.py +0 -11
  93. airflow/providers/google/cloud/transfers/sftp_to_gcs.py +0 -11
  94. airflow/providers/google/cloud/transfers/sheets_to_gcs.py +0 -12
  95. airflow/providers/google/cloud/transfers/sql_to_gcs.py +0 -11
  96. airflow/providers/google/cloud/triggers/bigquery_dts.py +0 -12
  97. airflow/providers/google/cloud/triggers/cloud_build.py +0 -11
  98. airflow/providers/google/cloud/triggers/cloud_composer.py +0 -9
  99. airflow/providers/google/cloud/triggers/dataflow.py +0 -7
  100. airflow/providers/google/cloud/triggers/datafusion.py +0 -11
  101. airflow/providers/google/cloud/triggers/dataproc.py +2 -8
  102. airflow/providers/google/cloud/triggers/kubernetes_engine.py +0 -4
  103. airflow/providers/google/cloud/triggers/mlengine.py +0 -3
  104. airflow/providers/google/common/hooks/discovery_api.py +0 -7
  105. airflow/providers/google/firebase/hooks/firestore.py +0 -10
  106. airflow/providers/google/get_provider_info.py +1 -0
  107. airflow/providers/google/marketing_platform/example_dags/example_display_video.py +0 -64
  108. airflow/providers/google/marketing_platform/hooks/campaign_manager.py +3 -3
  109. airflow/providers/google/marketing_platform/hooks/display_video.py +7 -38
  110. airflow/providers/google/marketing_platform/operators/campaign_manager.py +22 -22
  111. airflow/providers/google/marketing_platform/operators/display_video.py +0 -284
  112. airflow/providers/google/marketing_platform/sensors/campaign_manager.py +3 -3
  113. airflow/providers/google/marketing_platform/sensors/display_video.py +0 -65
  114. airflow/providers/google/suite/transfers/gcs_to_gdrive.py +0 -4
  115. airflow/providers/google/suite/transfers/gcs_to_sheets.py +0 -4
  116. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/METADATA +33 -4
  117. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/RECORD +122 -122
  118. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/LICENSE +0 -0
  119. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/NOTICE +0 -0
  120. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/WHEEL +0 -0
  121. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/entry_points.txt +0 -0
  122. {apache_airflow_providers_google-9.0.0rc2.dist-info → apache_airflow_providers_google-10.0.0rc1.dist-info}/top_level.txt +0 -0
@@ -23,7 +23,6 @@ import json
23
23
  import shutil
24
24
  import tempfile
25
25
  import urllib.request
26
- import warnings
27
26
  from typing import TYPE_CHECKING, Any, Sequence
28
27
  from urllib.parse import urlsplit
29
28
 
@@ -36,84 +35,6 @@ if TYPE_CHECKING:
36
35
  from airflow.utils.context import Context
37
36
 
38
37
 
39
- class GoogleDisplayVideo360CreateReportOperator(BaseOperator):
40
- """
41
- Creates a query.
42
-
43
- .. seealso::
44
- For more information on how to use this operator, take a look at the guide:
45
- :ref:`howto/operator:GoogleDisplayVideo360CreateReportOperator`
46
-
47
- .. seealso::
48
- Check also the official API docs:
49
- `https://developers.google.com/bid-manager/v1/queries/createquery`
50
-
51
- :param body: Report object passed to the request's body as described here:
52
- https://developers.google.com/bid-manager/v1/queries#resource
53
- :param api_version: The version of the api that will be requested for example 'v3'.
54
- :param gcp_conn_id: The connection ID to use when fetching connection info.
55
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
56
- if any. For this to work, the service account making the request must have
57
- domain-wide delegation enabled.
58
- :param impersonation_chain: Optional service account to impersonate using short-term
59
- credentials, or chained list of accounts required to get the access_token
60
- of the last account in the list, which will be impersonated in the request.
61
- If set as a string, the account must grant the originating account
62
- the Service Account Token Creator IAM role.
63
- If set as a sequence, the identities from the list must grant
64
- Service Account Token Creator IAM role to the directly preceding identity, with first
65
- account from the list granting this role to the originating account (templated).
66
- """
67
-
68
- template_fields: Sequence[str] = (
69
- "body",
70
- "impersonation_chain",
71
- )
72
- template_ext: Sequence[str] = (".json",)
73
-
74
- def __init__(
75
- self,
76
- *,
77
- body: dict[str, Any],
78
- api_version: str = "v1",
79
- gcp_conn_id: str = "google_cloud_default",
80
- delegate_to: str | None = None,
81
- impersonation_chain: str | Sequence[str] | None = None,
82
- **kwargs,
83
- ) -> None:
84
- super().__init__(**kwargs)
85
- self.body = body
86
-
87
- warnings.warn(
88
- "This operator is deprecated. Please use `GoogleDisplayVideo360CreateQueryOperator`",
89
- DeprecationWarning,
90
- )
91
- self.api_version = api_version
92
- self.gcp_conn_id = gcp_conn_id
93
- self.delegate_to = delegate_to
94
- self.impersonation_chain = impersonation_chain
95
-
96
- def prepare_template(self) -> None:
97
- # If .json is passed then we have to read the file
98
- if isinstance(self.body, str) and self.body.endswith(".json"):
99
- with open(self.body) as file:
100
- self.body = json.load(file)
101
-
102
- def execute(self, context: Context) -> dict:
103
- hook = GoogleDisplayVideo360Hook(
104
- gcp_conn_id=self.gcp_conn_id,
105
- delegate_to=self.delegate_to,
106
- api_version=self.api_version,
107
- impersonation_chain=self.impersonation_chain,
108
- )
109
- self.log.info("Creating Display & Video 360 report.")
110
- response = hook.create_query(query=self.body)
111
- report_id = response["queryId"]
112
- self.xcom_push(context, key="report_id", value=report_id)
113
- self.log.info("Created report with ID: %s", report_id)
114
- return response
115
-
116
-
117
38
  class GoogleDisplayVideo360CreateQueryOperator(BaseOperator):
118
39
  """
119
40
  Creates a query.
@@ -235,11 +156,6 @@ class GoogleDisplayVideo360DeleteReportOperator(BaseOperator):
235
156
  super().__init__(**kwargs)
236
157
  self.report_id = report_id
237
158
  self.report_name = report_name
238
- if api_version in ["v1", "v1.1"]:
239
- warnings.warn(
240
- f"API {api_version} is deprecated and shortly will be removed please use v2",
241
- DeprecationWarning,
242
- )
243
159
  self.api_version = api_version
244
160
  self.gcp_conn_id = gcp_conn_id
245
161
  self.delegate_to = delegate_to
@@ -272,132 +188,6 @@ class GoogleDisplayVideo360DeleteReportOperator(BaseOperator):
272
188
  self.log.info("Report deleted.")
273
189
 
274
190
 
275
- class GoogleDisplayVideo360DownloadReportOperator(BaseOperator):
276
- """
277
- Retrieves a stored query.
278
-
279
- .. seealso::
280
- For more information on how to use this operator, take a look at the guide:
281
- :ref:`howto/operator:GoogleDisplayVideo360DownloadReportOperator`
282
-
283
- .. seealso::
284
- Check also the official API docs:
285
- `https://developers.google.com/bid-manager/v1/queries/getquery`
286
-
287
- :param report_id: Report ID to retrieve.
288
- :param bucket_name: The bucket to upload to.
289
- :param report_name: The report name to set when uploading the local file.
290
- :param chunk_size: File will be downloaded in chunks of this many bytes.
291
- :param gzip: Option to compress local file or file data for upload
292
- :param api_version: The version of the api that will be requested for example 'v3'.
293
- :param gcp_conn_id: The connection ID to use when fetching connection info.
294
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
295
- if any. For this to work, the service account making the request must have
296
- domain-wide delegation enabled.
297
- :param impersonation_chain: Optional service account to impersonate using short-term
298
- credentials, or chained list of accounts required to get the access_token
299
- of the last account in the list, which will be impersonated in the request.
300
- If set as a string, the account must grant the originating account
301
- the Service Account Token Creator IAM role.
302
- If set as a sequence, the identities from the list must grant
303
- Service Account Token Creator IAM role to the directly preceding identity, with first
304
- account from the list granting this role to the originating account (templated).
305
- """
306
-
307
- template_fields: Sequence[str] = (
308
- "report_id",
309
- "bucket_name",
310
- "report_name",
311
- "impersonation_chain",
312
- )
313
-
314
- def __init__(
315
- self,
316
- *,
317
- report_id: str,
318
- bucket_name: str,
319
- report_name: str | None = None,
320
- gzip: bool = True,
321
- chunk_size: int = 10 * 1024 * 1024,
322
- api_version: str = "v1",
323
- gcp_conn_id: str = "google_cloud_default",
324
- delegate_to: str | None = None,
325
- impersonation_chain: str | Sequence[str] | None = None,
326
- **kwargs,
327
- ) -> None:
328
- super().__init__(**kwargs)
329
- warnings.warn(
330
- "This operator is deprecated. Please use `GoogleDisplayVideo360DownloadReportV2Operator`",
331
- DeprecationWarning,
332
- )
333
- self.report_id = report_id
334
- self.chunk_size = chunk_size
335
- self.gzip = gzip
336
- self.bucket_name = bucket_name
337
- self.report_name = report_name
338
- self.api_version = api_version
339
- self.gcp_conn_id = gcp_conn_id
340
- self.delegate_to = delegate_to
341
- self.impersonation_chain = impersonation_chain
342
-
343
- def _resolve_file_name(self, name: str) -> str:
344
- new_name = name if name.endswith(".csv") else f"{name}.csv"
345
- new_name = f"{new_name}.gz" if self.gzip else new_name
346
- return new_name
347
-
348
- @staticmethod
349
- def _set_bucket_name(name: str) -> str:
350
- bucket = name if not name.startswith("gs://") else name[5:]
351
- return bucket.strip("/")
352
-
353
- def execute(self, context: Context):
354
- hook = GoogleDisplayVideo360Hook(
355
- gcp_conn_id=self.gcp_conn_id,
356
- delegate_to=self.delegate_to,
357
- api_version=self.api_version,
358
- impersonation_chain=self.impersonation_chain,
359
- )
360
- gcs_hook = GCSHook(
361
- gcp_conn_id=self.gcp_conn_id,
362
- delegate_to=self.delegate_to,
363
- impersonation_chain=self.impersonation_chain,
364
- )
365
-
366
- resource = hook.get_query(query_id=self.report_id)
367
- # Check if report is ready
368
- if resource["metadata"]["running"]:
369
- raise AirflowException(f"Report {self.report_id} is still running")
370
-
371
- # If no custom report_name provided, use DV360 name
372
- file_url = resource["metadata"]["googleCloudStoragePathForLatestReport"]
373
- report_name = self.report_name or urlsplit(file_url).path.split("/")[-1]
374
- report_name = self._resolve_file_name(report_name)
375
-
376
- # Download the report
377
- self.log.info("Starting downloading report %s", self.report_id)
378
- with tempfile.NamedTemporaryFile(delete=False) as temp_file:
379
- with urllib.request.urlopen(file_url) as response:
380
- shutil.copyfileobj(response, temp_file, length=self.chunk_size)
381
-
382
- temp_file.flush()
383
- # Upload the local file to bucket
384
- bucket_name = self._set_bucket_name(self.bucket_name)
385
- gcs_hook.upload(
386
- bucket_name=bucket_name,
387
- object_name=report_name,
388
- gzip=self.gzip,
389
- filename=temp_file.name,
390
- mime_type="text/csv",
391
- )
392
- self.log.info(
393
- "Report %s was saved in bucket %s as %s.",
394
- self.report_id,
395
- self.bucket_name,
396
- report_name,
397
- )
398
- self.xcom_push(context, key="report_name", value=report_name)
399
-
400
-
401
191
  class GoogleDisplayVideo360DownloadReportV2Operator(BaseOperator):
402
192
  """
403
193
  Retrieves a stored query.
@@ -523,80 +313,6 @@ class GoogleDisplayVideo360DownloadReportV2Operator(BaseOperator):
523
313
  self.xcom_push(context, key="report_name", value=report_name)
524
314
 
525
315
 
526
- class GoogleDisplayVideo360RunReportOperator(BaseOperator):
527
- """
528
- Runs a stored query to generate a report.
529
-
530
- .. seealso::
531
- For more information on how to use this operator, take a look at the guide:
532
- :ref:`howto/operator:GoogleDisplayVideo360RunReportOperator`
533
-
534
- .. seealso::
535
- Check also the official API docs:
536
- `https://developers.google.com/bid-manager/v1/queries/runquery`
537
-
538
- :param report_id: Report ID to run.
539
- :param parameters: Parameters for running a report as described here:
540
- https://developers.google.com/bid-manager/v1/queries/runquery
541
- :param api_version: The version of the api that will be requested for example 'v3'.
542
- :param gcp_conn_id: The connection ID to use when fetching connection info.
543
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
544
- if any. For this to work, the service account making the request must have
545
- domain-wide delegation enabled.
546
- :param impersonation_chain: Optional service account to impersonate using short-term
547
- credentials, or chained list of accounts required to get the access_token
548
- of the last account in the list, which will be impersonated in the request.
549
- If set as a string, the account must grant the originating account
550
- the Service Account Token Creator IAM role.
551
- If set as a sequence, the identities from the list must grant
552
- Service Account Token Creator IAM role to the directly preceding identity, with first
553
- account from the list granting this role to the originating account (templated).
554
- """
555
-
556
- template_fields: Sequence[str] = (
557
- "report_id",
558
- "parameters",
559
- "impersonation_chain",
560
- )
561
-
562
- def __init__(
563
- self,
564
- *,
565
- report_id: str,
566
- parameters: dict[str, Any] | None = None,
567
- api_version: str = "v1",
568
- gcp_conn_id: str = "google_cloud_default",
569
- delegate_to: str | None = None,
570
- impersonation_chain: str | Sequence[str] | None = None,
571
- **kwargs,
572
- ) -> None:
573
- super().__init__(**kwargs)
574
- self.report_id = report_id
575
- warnings.warn(
576
- "This operator is deprecated. Please use `GoogleDisplayVideo360RunQueryOperator`",
577
- DeprecationWarning,
578
- )
579
- self.api_version = api_version
580
- self.gcp_conn_id = gcp_conn_id
581
- self.delegate_to = delegate_to
582
- self.parameters = parameters
583
- self.impersonation_chain = impersonation_chain
584
-
585
- def execute(self, context: Context) -> None:
586
- hook = GoogleDisplayVideo360Hook(
587
- gcp_conn_id=self.gcp_conn_id,
588
- delegate_to=self.delegate_to,
589
- api_version=self.api_version,
590
- impersonation_chain=self.impersonation_chain,
591
- )
592
- self.log.info(
593
- "Running report %s with the following parameters:\n %s",
594
- self.report_id,
595
- self.parameters,
596
- )
597
- hook.run_query(query_id=self.report_id, params=self.parameters)
598
-
599
-
600
316
  class GoogleDisplayVideo360RunQueryOperator(BaseOperator):
601
317
  """
602
318
  Runs a stored query to generate a report.
@@ -33,7 +33,7 @@ class GoogleCampaignManagerReportSensor(BaseSensorOperator):
33
33
 
34
34
  .. seealso::
35
35
  Check official API docs:
36
- https://developers.google.com/doubleclick-advertisers/v3.3/reports/get
36
+ https://developers.google.com/doubleclick-advertisers/rest/v4/reports/get
37
37
 
38
38
  .. seealso::
39
39
  For more information on how to use this operator, take a look at the guide:
@@ -42,7 +42,7 @@ class GoogleCampaignManagerReportSensor(BaseSensorOperator):
42
42
  :param profile_id: The DFA user profile ID.
43
43
  :param report_id: The ID of the report.
44
44
  :param file_id: The ID of the report file.
45
- :param api_version: The version of the api that will be requested for example 'v3'.
45
+ :param api_version: The version of the api that will be requested, for example 'v4'.
46
46
  :param gcp_conn_id: The connection ID to use when fetching connection info.
47
47
  :param delegate_to: The account to impersonate using domain-wide delegation of authority,
48
48
  if any. For this to work, the service account making the request must have
@@ -81,7 +81,7 @@ class GoogleCampaignManagerReportSensor(BaseSensorOperator):
81
81
  profile_id: str,
82
82
  report_id: str,
83
83
  file_id: str,
84
- api_version: str = "v3.3",
84
+ api_version: str = "v4",
85
85
  gcp_conn_id: str = "google_cloud_default",
86
86
  delegate_to: str | None = None,
87
87
  mode: str = "reschedule",
@@ -17,7 +17,6 @@
17
17
  """Sensor for detecting the completion of DV360 reports."""
18
18
  from __future__ import annotations
19
19
 
20
- import warnings
21
20
  from typing import TYPE_CHECKING, Sequence
22
21
 
23
22
  from airflow import AirflowException
@@ -28,70 +27,6 @@ if TYPE_CHECKING:
28
27
  from airflow.utils.context import Context
29
28
 
30
29
 
31
- class GoogleDisplayVideo360ReportSensor(BaseSensorOperator):
32
- """
33
- Sensor for detecting the completion of DV360 reports.
34
-
35
- .. seealso::
36
- For more information on how to use this operator, take a look at the guide:
37
- :ref:`howto/operator:GoogleDisplayVideo360ReportSensor`
38
-
39
- :param report_id: Report ID to delete.
40
- :param api_version: The version of the api that will be requested for example 'v3'.
41
- :param gcp_conn_id: The connection ID to use when fetching connection info.
42
- :param delegate_to: The account to impersonate using domain-wide delegation of authority,
43
- if any. For this to work, the service account making the request must have
44
- domain-wide delegation enabled.
45
- :param impersonation_chain: Optional service account to impersonate using short-term
46
- credentials, or chained list of accounts required to get the access_token
47
- of the last account in the list, which will be impersonated in the request.
48
- If set as a string, the account must grant the originating account
49
- the Service Account Token Creator IAM role.
50
- If set as a sequence, the identities from the list must grant
51
- Service Account Token Creator IAM role to the directly preceding identity, with first
52
- account from the list granting this role to the originating account (templated).
53
- """
54
-
55
- template_fields: Sequence[str] = (
56
- "report_id",
57
- "impersonation_chain",
58
- )
59
-
60
- def __init__(
61
- self,
62
- *,
63
- report_id: str,
64
- api_version: str = "v1",
65
- gcp_conn_id: str = "google_cloud_default",
66
- delegate_to: str | None = None,
67
- impersonation_chain: str | Sequence[str] | None = None,
68
- **kwargs,
69
- ) -> None:
70
- super().__init__(**kwargs)
71
- warnings.warn(
72
- "This operator is deprecated. Please use `GoogleDisplayVideo360RunQuerySensor`",
73
- DeprecationWarning,
74
- )
75
- self.report_id = report_id
76
- self.api_version = api_version
77
- self.gcp_conn_id = gcp_conn_id
78
- self.delegate_to = delegate_to
79
- self.impersonation_chain = impersonation_chain
80
-
81
- def poke(self, context: Context) -> bool:
82
- hook = GoogleDisplayVideo360Hook(
83
- gcp_conn_id=self.gcp_conn_id,
84
- delegate_to=self.delegate_to,
85
- api_version=self.api_version,
86
- impersonation_chain=self.impersonation_chain,
87
- )
88
-
89
- response = hook.get_query(query_id=self.report_id)
90
- if response and not response.get("metadata", {}).get("running"):
91
- return True
92
- return False
93
-
94
-
95
30
  class GoogleDisplayVideo360GetSDFDownloadOperationSensor(BaseSensorOperator):
96
31
  """
97
32
  Sensor for detecting the completion of SDF operation.
@@ -95,7 +95,6 @@ class GCSToGoogleDriveOperator(BaseOperator):
95
95
  destination_object: str | None = None,
96
96
  move_object: bool = False,
97
97
  gcp_conn_id: str = "google_cloud_default",
98
- delegate_to: str | None = None,
99
98
  impersonation_chain: str | Sequence[str] | None = None,
100
99
  **kwargs,
101
100
  ) -> None:
@@ -106,7 +105,6 @@ class GCSToGoogleDriveOperator(BaseOperator):
106
105
  self.destination_object = destination_object
107
106
  self.move_object = move_object
108
107
  self.gcp_conn_id = gcp_conn_id
109
- self.delegate_to = delegate_to
110
108
  self.impersonation_chain = impersonation_chain
111
109
  self.gcs_hook: GCSHook | None = None
112
110
  self.gdrive_hook: GoogleDriveHook | None = None
@@ -115,12 +113,10 @@ class GCSToGoogleDriveOperator(BaseOperator):
115
113
 
116
114
  self.gcs_hook = GCSHook(
117
115
  gcp_conn_id=self.gcp_conn_id,
118
- delegate_to=self.delegate_to,
119
116
  impersonation_chain=self.impersonation_chain,
120
117
  )
121
118
  self.gdrive_hook = GoogleDriveHook(
122
119
  gcp_conn_id=self.gcp_conn_id,
123
- delegate_to=self.delegate_to,
124
120
  impersonation_chain=self.impersonation_chain,
125
121
  )
126
122
 
@@ -67,7 +67,6 @@ class GCSToGoogleSheetsOperator(BaseOperator):
67
67
  object_name: str,
68
68
  spreadsheet_range: str = "Sheet1",
69
69
  gcp_conn_id: str = "google_cloud_default",
70
- delegate_to: str | None = None,
71
70
  impersonation_chain: str | Sequence[str] | None = None,
72
71
  **kwargs,
73
72
  ) -> None:
@@ -78,18 +77,15 @@ class GCSToGoogleSheetsOperator(BaseOperator):
78
77
  self.spreadsheet_range = spreadsheet_range
79
78
  self.bucket_name = bucket_name
80
79
  self.object_name = object_name
81
- self.delegate_to = delegate_to
82
80
  self.impersonation_chain = impersonation_chain
83
81
 
84
82
  def execute(self, context: Any) -> None:
85
83
  sheet_hook = GSheetsHook(
86
84
  gcp_conn_id=self.gcp_conn_id,
87
- delegate_to=self.delegate_to,
88
85
  impersonation_chain=self.impersonation_chain,
89
86
  )
90
87
  gcs_hook = GCSHook(
91
88
  gcp_conn_id=self.gcp_conn_id,
92
- delegate_to=self.delegate_to,
93
89
  impersonation_chain=self.impersonation_chain,
94
90
  )
95
91
  with NamedTemporaryFile("w+") as temp_file:
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: apache-airflow-providers-google
3
- Version: 9.0.0rc2
3
+ Version: 10.0.0rc1
4
4
  Summary: Provider for Apache Airflow. Implements apache-airflow-providers-google package
5
5
  Home-page: https://airflow.apache.org/
6
6
  Download-URL: https://archive.apache.org/dist/airflow/providers
7
7
  Author: Apache Software Foundation
8
8
  Author-email: dev@airflow.apache.org
9
9
  License: Apache License 2.0
10
- Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-google/9.0.0/
10
+ Project-URL: Documentation, https://airflow.apache.org/docs/apache-airflow-providers-google/10.0.0/
11
11
  Project-URL: Bug Tracker, https://github.com/apache/airflow/issues
12
12
  Project-URL: Source Code, https://github.com/apache/airflow
13
13
  Project-URL: Slack Chat, https://s.apache.org/airflow-slack
@@ -145,7 +145,7 @@ Requires-Dist: apache-airflow-providers-trino ; extra == 'trino'
145
145
 
146
146
  Package ``apache-airflow-providers-google``
147
147
 
148
- Release: ``9.0.0rc2``
148
+ Release: ``10.0.0rc1``
149
149
 
150
150
 
151
151
  Google services including:
@@ -165,7 +165,7 @@ This is a provider package for ``google`` provider. All classes for this provide
165
165
  are in ``airflow.providers.google`` python package.
166
166
 
167
167
  You can find package information and changelog for the provider
168
- in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-google/9.0.0/>`_.
168
+ in the `documentation <https://airflow.apache.org/docs/apache-airflow-providers-google/10.0.0/>`_.
169
169
 
170
170
 
171
171
  Installation
@@ -302,6 +302,35 @@ Dependent package
302
302
  Changelog
303
303
  ---------
304
304
 
305
+ 10.0.0
306
+ ......
307
+
308
+ Breaking changes
309
+ ~~~~~~~~~~~~~~~~
310
+
311
+ Google has announced sunset of Campaign Manager 360 v3.5 by Apr 20, 2023. For more information
312
+ please check: `<https://developers.google.com/doubleclick-advertisers/deprecation>`_ . As a result, the
313
+ default api version for Campaign Manager 360 operator was updated to the latest v4 version.
314
+
315
+ .. warning::
316
+ In this version of the provider, deprecated ``delegate_to`` param is removed from all GCP operators, hooks, and triggers, as well as from firestore and gsuite
317
+ transfer operators that interact with GCS. Impersonation can be achieved instead by utilizing the ``impersonation_chain`` param.
318
+ The ``delegate_to`` param will still be available only in gsuite and marketing platform hooks and operators, that don't interact with Google Cloud.
319
+
320
+ * ``remove delegate_to from GCP operators and hooks (#30748)``
321
+ * ``Update Google Campaign Manager360 operators to use API v4 (#30598)``
322
+
323
+ Bug Fixes
324
+ ~~~~~~~~~
325
+
326
+ * ``Update DataprocCreateCluster operator to use 'label' parameter properly (#30741)``
327
+
328
+ Misc
329
+ ~~~~
330
+
331
+ * ``add missing project_id in BigQueryGetDataOperator (#30651)``
332
+ * ``Display Video 360 cleanup v1 API usage (#30577)``
333
+
305
334
  9.0.0
306
335
  .....
307
336