Skip to content

Commit 36ffbee

Browse files
authored
Add D400 pydocstyle check - Google provider only (#31422)
1 parent def4b53 commit 36ffbee

File tree

116 files changed

+487
-432
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+487
-432
lines changed

β€Žairflow/providers/google/ads/hooks/ads.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ def list_accessible_customers(self) -> list[str]:
152152

153153
@cached_property
154154
def _get_service(self) -> GoogleAdsServiceClient:
155-
"""Connects and authenticates with the Google Ads API using a service account"""
155+
"""Connects and authenticates with the Google Ads API using a service account."""
156156
client = self._get_client
157157
return client.get_service("GoogleAdsService", version=self.api_version)
158158

@@ -170,7 +170,7 @@ def _get_client(self) -> GoogleAdsClient:
170170

171171
@cached_property
172172
def _get_customer_service(self) -> CustomerServiceClient:
173-
"""Connects and authenticates with the Google Ads API using a service account"""
173+
"""Connects and authenticates with the Google Ads API using a service account."""
174174
with NamedTemporaryFile("w", suffix=".json") as secrets_temp:
175175
self._get_config()
176176
self._update_config_with_secret(secrets_temp)
@@ -184,7 +184,7 @@ def _get_customer_service(self) -> CustomerServiceClient:
184184
def _get_config(self) -> None:
185185
"""
186186
Gets google ads connection from meta db and sets google_ads_config attribute with returned config
187-
file
187+
file.
188188
"""
189189
conn = self.get_connection(self.google_ads_conn_id)
190190
if "google_ads_client" not in conn.extra_dejson:
@@ -196,7 +196,7 @@ def _update_config_with_secret(self, secrets_temp: IO[str]) -> None:
196196
"""
197197
Gets Google Cloud secret from connection and saves the contents to the temp file
198198
Updates google ads config with file path of the temp file containing the secret
199-
Note, the secret must be passed as a file path for Google Ads API
199+
Note, the secret must be passed as a file path for Google Ads API.
200200
"""
201201
extras = self.get_connection(self.gcp_conn_id).extra_dejson
202202
secret = get_field(extras, "keyfile_dict")
@@ -211,7 +211,7 @@ def _search(
211211
self, client_ids: list[str], query: str, page_size: int = 10000, **kwargs
212212
) -> list[GoogleAdsRow]:
213213
"""
214-
Pulls data from the Google Ads API
214+
Pulls data from the Google Ads API.
215215
216216
:param client_ids: Google Ads client ID(s) to query the API for.
217217
:param query: Google Ads Query Language query.
@@ -232,7 +232,7 @@ def _search(
232232

233233
def _extract_rows(self, iterators: list[GRPCIterator]) -> list[GoogleAdsRow]:
234234
"""
235-
Convert Google Page Iterator (GRPCIterator) objects to Google Ads Rows
235+
Convert Google Page Iterator (GRPCIterator) objects to Google Ads Rows.
236236
237237
:param iterators: List of Google Page Iterator (GRPCIterator) objects
238238

β€Žairflow/providers/google/ads/transfers/ads_to_gcs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class GoogleAdsToGcsOperator(BaseOperator):
3333
"""
3434
Fetches the daily results from the Google Ads API for 1-n clients
3535
Converts and saves the data as a temporary CSV file
36-
Uploads the CSV to Google Cloud Storage
36+
Uploads the CSV to Google Cloud Storage.
3737
3838
.. seealso::
3939
For more information on the Google Ads API, take a look at the API docs:

β€Žairflow/providers/google/cloud/_internal_client/secret_manager_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class _SecretManagerClient(LoggingMixin):
3333
"""
3434
Retrieves Secrets object from Google Cloud Secrets Manager. This is a common class reused between
3535
SecretsManager and Secrets Hook that provides the shared authentication and verification mechanisms.
36-
This class should not be used directly, use SecretsManager or SecretsHook instead
36+
This class should not be used directly, use SecretsManager or SecretsHook instead.
3737
3838
3939
:param credentials: Credentials used to authenticate to GCP
@@ -50,14 +50,15 @@ def __init__(
5050
def is_valid_secret_name(secret_name: str) -> bool:
5151
"""
5252
Returns true if the secret name is valid.
53+
5354
:param secret_name: name of the secret
5455
:return:
5556
"""
5657
return bool(re.match(SECRET_ID_PATTERN, secret_name))
5758

5859
@cached_property
5960
def client(self) -> SecretManagerServiceClient:
60-
"""Create an authenticated KMS client"""
61+
"""Create an authenticated KMS client."""
6162
_client = SecretManagerServiceClient(credentials=self.credentials, client_info=CLIENT_INFO)
6263
return _client
6364

0 commit comments

Comments
 (0)