Skip to content

Commit 3808a62

Browse files
authored
Unify Google class/package names (#8033)
1 parent 8c2bd91 commit 3808a62

24 files changed

+625
-430
lines changed

β€Žairflow/contrib/operators/gcp_translate_speech_operator.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,26 @@
2020
import warnings
2121

2222
# pylint: disable=unused-import
23-
from airflow.providers.google.cloud.operators.translate_speech import GcpTranslateSpeechOperator # noqa
23+
from airflow.providers.google.cloud.operators.translate_speech import CloudTranslateSpeechOperator # noqa
2424

2525
warnings.warn(
2626
"This module is deprecated. Please use `airflow.providers.google.cloud.operators.translate_speech`.",
2727
DeprecationWarning, stacklevel=2
2828
)
29+
30+
31+
class GcpTranslateSpeechOperator(CloudTranslateSpeechOperator):
32+
"""
33+
This class is deprecated.
34+
Please use `airflow.providers.google.cloud.operators.translate_speech.CloudTranslateSpeechOperator`.
35+
"""
36+
37+
def __init__(self, *args, **kwargs):
38+
warnings.warn(
39+
"""This class is deprecated.
40+
Please use
41+
`airflow.providers.google.cloud.operators.translate_speech.CloudTranslateSpeechOperator`.
42+
""",
43+
DeprecationWarning, stacklevel=2
44+
)
45+
super().__init__(*args, **kwargs)

β€Žairflow/providers/google/BACKPORT_README.md

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@
2626
- [v2020.XX.XX](#v2020xxxx)
2727
- [Limitations](#limitations)
2828
- [New operators](#new-operators)
29-
- [Google Cloud operators](#google-cloud-operators)
30-
- [Marketing platform operators](#marketing-platform-operators)
31-
- [Ads operators](#ads-operators)
29+
- [Google Cloud Platform operators](#google-cloud-platform-operators)
30+
- [Google Marketing Platform operators](#google-marketing-platform-operators)
31+
- [Google Suite operators](#google-suite-operators)
32+
- [Google Ads operators](#google-ads-operators)
33+
- [Google Firebase operators](#google-firebase-operators)
3234
- [Updated operators](#updated-operators)
33-
- [Google Cloud operators](#google-cloud-operators-1)
34-
- [GSuite operators](#gsuite-operators)
35+
- [Google Cloud Platform operators](#google-cloud-platform-operators-1)
36+
- [Google Suite operators](#google-suite-operators-1)
3537

3638
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
3739

@@ -54,13 +56,13 @@ We have worked intensively on operators that have not appeared in any Airflow re
5456
through this package. This release includes the following new operators:
5557

5658

57-
##### Google Cloud operators
59+
##### Google Cloud Platform operators
5860

5961
All operators in `airflow.providers.google.cloud.operators` package
6062

6163
* [AutoML](https://cloud.google.com/automl/)
6264

63-
All operators in `automl` sub-package.
65+
All operators in `automl` module.
6466

6567
* AutoMLBatchPredictOperator
6668
* AutoMLCreateDatasetOperator
@@ -78,15 +80,15 @@ All operators in `airflow.providers.google.cloud.operators` package
7880

7981
* [BigQuery Data Transfer Service](https://cloud.google.com/bigquery/transfer/)
8082

81-
All operators in `bigquery_dts` sub-package.
83+
All operators in `bigquery_dts` module
8284

8385
* BigQueryCreateDataTransferOperator
8486
* BigQueryDataTransferServiceStartTransferRunsOperator
8587
* BigQueryDeleteDataTransferConfigOperator
8688

8789
* [Cloud Memorystore](https://cloud.google.com/memorystore/)
8890

89-
All operators in `cloud_memorystore` sub-package.
91+
All operators in `cloud_memorystore` module.
9092

9193
* CloudMemorystoreCreateInstanceAndImportOperator
9294
* CloudMemorystoreCreateInstanceOperator
@@ -102,7 +104,7 @@ All operators in `airflow.providers.google.cloud.operators` package
102104

103105
* [Data Catalog](https://cloud.google.com/data-catalog)
104106

105-
All operators in `datacatalog` sub-package.
107+
All operators in `datacatalog` module.
106108

107109
* CloudDataCatalogCreateEntryGroupOperator
108110
* CloudDataCatalogCreateEntryOperator
@@ -128,14 +130,14 @@ All operators in `airflow.providers.google.cloud.operators` package
128130

129131
* [Dataproc](https://cloud.google.com/dataproc/)
130132

131-
All operators in `dataproc` sub-package.
133+
All operators in `dataproc` module.
132134

133135
* DataprocSubmitJobOperator
134136
* DataprocUpdateClusterOperator
135137

136138
* [Data Fusion](https://cloud.google.com/data-fusion/)
137139

138-
All operators in `datafusion` sub-package.
140+
All operators in `datafusion` module.
139141

140142
* CloudDataFusionCreateInstanceOperator
141143
* CloudDataFusionCreatePipelineOperator
@@ -150,27 +152,27 @@ All operators in `airflow.providers.google.cloud.operators` package
150152

151153
* [Cloud Functions](https://cloud.google.com/functions/)
152154

153-
All operators in `functions` sub-package.
155+
All operators in `functions` module.
154156

155157
* CloudFunctionInvokeFunctionOperator
156158

157159
* [Cloud Storage (GCS)](https://cloud.google.com/gcs/)
158160

159-
All operators in `gcs` sub-package.
161+
All operators in `gcs` module.
160162

161163
* GCSDeleteBucketOperator
162-
* GcsFileTransformOperator
164+
* GCSFileTransformOperator
163165

164166
* [Dataproc](https://cloud.google.com/dataproc/)
165167

166-
All operators in `dataproc` sub-package.
168+
All operators in `dataproc` module.
167169

168170
* DataprocSubmitJobOperator
169171
* DataprocUpdateClusterOperator
170172

171173
* [Machine Learning Engine](https://cloud.google.com/ml-engine/)
172174

173-
All operators in `mlengine` sub-package.
175+
All operators in `mlengine` module.
174176

175177
* MLEngineCreateModelOperator
176178
* MLEngineCreateVersionOperator
@@ -179,17 +181,17 @@ All operators in `airflow.providers.google.cloud.operators` package
179181
* MLEngineGetModelOperator
180182
* MLEngineListVersionsOperator
181183
* MLEngineSetDefaultVersionOperator
182-
* MLEngineTrainingJobFailureOperator
184+
* MLEngineTrainingCancelJobOperator
183185

184186
* [Cloud Pub/Sub](https://cloud.google.com/pubsub/)
185187

186-
All operators in `pubsub` package.
188+
All operators in `pubsub` module.
187189

188190
* PubSubPullOperator
189191

190192
* [Cloud Stackdriver](https://cloud.google.com/stackdriver)
191193

192-
All operators in `stackdriver` sub-package.
194+
All operators in `stackdriver` module.
193195

194196
* StackdriverDeleteAlertOperator
195197
* StackdriverDeleteNotificationChannelOperator
@@ -204,7 +206,7 @@ All operators in `airflow.providers.google.cloud.operators` package
204206

205207
* [Cloud Tasks](https://cloud.google.com/tasks/)
206208

207-
All operators in `tasks` sub-package.
209+
All operators in `tasks` module.
208210

209211
* CloudTasksQueueCreateOperator
210212
* CloudTasksQueueDeleteOperator
@@ -220,29 +222,22 @@ All operators in `airflow.providers.google.cloud.operators` package
220222
* CloudTasksTaskRunOperator
221223
* CloudTasksTasksListOperator
222224

223-
* [Cloud Firestore](https://firebase.google.com/docs/firestore)
224-
225-
All operators in `firestore` sub-package.
226-
227-
* CloudFirestoreExportDatabaseOperator
228-
229225
* Transfer Google Cloud operators:
230226

231-
All operators in `airflow.providers.google.cloud.operators` sub-package:
232-
233227
* cassandra_to_gcs.CassandraToGCSOperator
234228
* gcs_to_gcs.GCSSynchronizeBuckets
235229
* gcs_to_sftp.GCSToSFTPOperator
236230
* presto_to_gcs.PrestoToGCSOperator
237231
* sftp_to_gcs.SFTPToGCSOperator
232+
* sheets_to_gcs.GoogleSheetsToGCSOperator
238233

239-
##### Marketing platform operators
234+
##### Google Marketing Platform operators
240235

241236
All operators in `airflow.providers.google.marketing_platform.operators` package
242237

243238
* [Analytics360](https://analytics.google.com/)
244239

245-
All operators in `analytics` sub-package.
240+
All operators in `analytics` module.
246241

247242
* GoogleAnalyticsDataImportUploadOperator
248243
* GoogleAnalyticsDeletePreviousDataUploadsOperator
@@ -253,7 +248,7 @@ All operators in `airflow.providers.google.marketing_platform.operators` package
253248

254249
* [Google Campaign Manager](https://developers.google.com/doubleclick-advertisers)
255250

256-
All operators in `campaign_manager` sub-package.
251+
All operators in `campaign_manager` module.
257252

258253
* GoogleCampaignManagerBatchInsertConversionsOperator
259254
* GoogleCampaignManagerBatchUpdateConversionsOperator
@@ -264,7 +259,7 @@ All operators in `airflow.providers.google.marketing_platform.operators` package
264259

265260
* [Google Display&Video 360](https://marketingplatform.google.com/about/display-video-360/)
266261

267-
All operators in `display_video` sub-package.
262+
All operators in `display_video` module.
268263

269264
* GoogleDisplayVideo360CreateReportOperator
270265
* GoogleDisplayVideo360DeleteReportOperator
@@ -273,41 +268,51 @@ All operators in `airflow.providers.google.marketing_platform.operators` package
273268

274269
* [Google Search Ads 360](https://marketingplatform.google.com/about/search-ads-360/)
275270

276-
All operators in `search_ads` sub-package.
271+
All operators in `search_ads` module.
277272

278273
* GoogleSearchAdsDownloadReportOperator
279274
* GoogleSearchAdsInsertReportOperator
280275

281-
**GSuite operators: `airflow.providers.google.suite.operators` package:**
276+
##### Google Suite operators
277+
278+
All operators in `airflow.providers.google.suite.operators` sub-package:
282279

283280
* [Google Spreadsheet](https://www.google.com/intl/en/sheets/about/)
284281

285-
All operators in `sheets` sub-package.
282+
All operators in `sheets` module.
286283

287-
* sheets.GoogleSheetsCreateSpreadsheet
284+
* GoogleSheetsCreateSpreadsheet
288285

289286
* Transfer Google Suite operators:
290-
All operators in `airflow.providers.google.cloud.operators` sub-package:
291287

292-
* airflow.providers.google.suite.operators.sheets.GCStoGoogleSheets
293-
* airflow.providers.google.suite.operators.sheets.GoogleSheetsToGCSOperator
288+
* gcs_to_sheets.GCSToGoogleSheetsOperator
294289

295-
##### Ads operators
290+
##### Google Ads operators
296291

297292
All operators in `airflow.providers.google.ads.operators` package
298293

299-
* [Ads](https://https://ads.google.com/)
294+
* [Google Ads](https://ads.google.com/)
300295

301-
All operators in `ads` sub-package.
296+
All operators in `ads` module.
302297

303-
* ads.GoogleAdsToGcsOperator
298+
* GoogleAdsToGcsOperator
299+
300+
##### Google Firebase operators
301+
302+
All operators in `airflow.providers.google.firebase.operators` package
303+
304+
* [Cloud Firestore](https://firebase.google.com/docs/firestore)
305+
306+
All operators in `firestore` module.
307+
308+
* CloudFirestoreExportDatabaseOperator
304309

305310
#### Updated operators
306311

307312
The operators in Airflow 2.0 have been moved to a new package. The following table showing operators
308313
from Airflow 1.10 and its equivalent from Airflow 2.0:
309314

310-
##### Google Cloud operators
315+
##### Google Cloud Platform operators
311316

312317
| Airflow 1.10 (`airflow.contrib.operators` package) | Airflow 2.0 (`airflow.providers.google.cloud.operators` package) |
313318
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|
@@ -418,7 +423,7 @@ from Airflow 1.10 and its equivalent from Airflow 2.0:
418423
| gcp_transfer_operator.GcpTransferServiceOperationsListOperator | cloud_storage_transfer_service.CloudDataTransferServiceListOperationsOperator |
419424
| gcp_transfer_operator.GoogleCloudStorageToGoogleCloudStorageTransferOperator | cloud_storage_transfer_service.CloudDataTransferServiceGCSToGCSOperator |
420425
| gcp_translate_operator.CloudTranslateTextOperator | translate.CloudTranslateTextOperator |
421-
| gcp_translate_speech_operator.GcpTranslateSpeechOperator | translate_speech.GcpTranslateSpeechOperator |
426+
| gcp_translate_speech_operator.GcpTranslateSpeechOperator | translate_speech.CloudTranslateSpeechOperator |
422427
| gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoExplicitContentOperator | video_intelligence.CloudVideoIntelligenceDetectVideoExplicitContentOperator |
423428
| gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoLabelsOperator | video_intelligence.CloudVideoIntelligenceDetectVideoLabelsOperator |
424429
| gcp_video_intelligence_operator.CloudVideoIntelligenceDetectVideoShotsOperator | video_intelligence.CloudVideoIntelligenceDetectVideoShotsOperator |
@@ -462,7 +467,7 @@ from Airflow 1.10 and its equivalent from Airflow 2.0:
462467
| s3_to_gcs_transfer_operator.CloudDataTransferServiceS3ToGCSOperator | cloud_storage_transfer_service.CloudDataTransferServiceS3ToGCSOperator |
463468
| sql_to_gcs.BaseSQLToGoogleCloudStorageOperator | sql_to_gcs.BaseSQLToGCSOperator |
464469

465-
##### GSuite operators
470+
##### Google Suite operators
466471

467472
| Airflow 1.10 (`airflow.contrib.operators` package) | Airflow 2.0 (`airflow.providers.google.suite.operators` package) |
468473
|------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------|

β€Žairflow/providers/google/cloud/example_dags/example_gcs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
from airflow.operators.bash import BashOperator
2626
from airflow.providers.google.cloud.operators.gcs import (
2727
GCSBucketCreateAclEntryOperator, GCSCreateBucketOperator, GCSDeleteBucketOperator,
28-
GCSDeleteObjectsOperator, GcsFileTransformOperator, GCSListObjectsOperator,
28+
GCSDeleteObjectsOperator, GCSFileTransformOperator, GCSListObjectsOperator,
2929
GCSObjectCreateAclEntryOperator, GCSToLocalOperator,
3030
)
3131
from airflow.providers.google.cloud.operators.gcs_to_gcs import GCSToGCSOperator
@@ -81,7 +81,7 @@
8181
bucket=BUCKET_1,
8282
)
8383

84-
transform_file = GcsFileTransformOperator(
84+
transform_file = GCSFileTransformOperator(
8585
task_id="transform_file",
8686
source_bucket=BUCKET_1,
8787
source_object=BUCKET_FILE_LOCATION,

β€Žairflow/providers/google/cloud/example_dags/example_speech.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
from airflow import models
3030
from airflow.providers.google.cloud.operators.speech_to_text import CloudSpeechToTextRecognizeSpeechOperator
3131
from airflow.providers.google.cloud.operators.text_to_speech import CloudTextToSpeechSynthesizeOperator
32-
from airflow.providers.google.cloud.operators.translate_speech import GcpTranslateSpeechOperator
32+
from airflow.providers.google.cloud.operators.translate_speech import CloudTranslateSpeechOperator
3333
from airflow.utils import dates
3434

3535
GCP_PROJECT_ID = os.environ.get("GCP_PROJECT_ID", "example-project")
@@ -87,7 +87,7 @@
8787
text_to_speech_synthesize_task >> speech_to_text_recognize_task
8888

8989
# [START howto_operator_translate_speech]
90-
translate_speech_task = GcpTranslateSpeechOperator(
90+
translate_speech_task = CloudTranslateSpeechOperator(
9191
project_id=GCP_PROJECT_ID,
9292
audio=AUDIO,
9393
config=CONFIG,

β€Žairflow/providers/google/cloud/operators/gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ def execute(self, context):
534534
user_project=self.user_project)
535535

536536

537-
class GcsFileTransformOperator(BaseOperator):
537+
class GCSFileTransformOperator(BaseOperator):
538538
"""
539539
Copies data from a source GCS location to a temporary location on the
540540
local filesystem. Runs a transformation on this file as specified by

β€Žairflow/providers/google/cloud/operators/mlengine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1053,7 +1053,7 @@ def check_existing_job(existing_job):
10531053
context['task_instance'].xcom_push("gcp_metadata", gcp_metadata)
10541054

10551055

1056-
class MLEngineTrainingJobFailureOperator(BaseOperator):
1056+
class MLEngineTrainingCancelJobOperator(BaseOperator):
10571057

10581058
"""
10591059
Operator for cleaning up failed MLEngine training job.

0 commit comments

Comments
 (0)