| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0652d52 commit f7c1b17
16 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,4 +13,4 @@ | |||
| 13 | 13 | # limitations under the License. | |
| 14 | 14 | docker: | |
| 15 | 15 | image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest | |
| 16 | - digest: sha256:6162c384d685c5fe22521d3f37f6fc732bf99a085f6d47b677dbcae97fc21392 | ||
| 16 | + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -314,7 +314,13 @@ | |||
| 314 | 314 | # One entry per manual page. List of tuples | |
| 315 | 315 | # (source start file, name, description, authors, manual section). | |
| 316 | 316 | man_pages = [ | |
| 317 | - (root_doc, "google-api-core", "google-api-core Documentation", [author], 1,) | ||
| 317 | + ( | ||
| 318 | + root_doc, | ||
| 319 | + "google-api-core", | ||
| 320 | + "google-api-core Documentation", | ||
| 321 | + [author], | ||
| 322 | + 1, | ||
| 323 | + ) | ||
| 318 | 324 | ] | |
| 319 | 325 | ||
| 320 | 326 | # If true, show URL addresses after external links. | |
@@ -355,7 +361,10 @@ | |||
| 355 | 361 | intersphinx_mapping = { | |
| 356 | 362 | "python": ("https://python.readthedocs.org/en/latest/", None), | |
| 357 | 363 | "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), | |
| 358 | - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), | ||
| 364 | + "google.api_core": ( | ||
| 365 | + "https://googleapis.dev/python/google-api-core/latest/", | ||
| 366 | + None, | ||
| 367 | + ), | ||
| 359 | 368 | "grpc": ("https://grpc.github.io/grpc/python/", None), | |
| 360 | 369 | "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), | |
| 361 | 370 | "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,7 +151,7 @@ def from_rfc3339(value): | |||
| 151 | 151 | micros = 0 | |
| 152 | 152 | else: | |
| 153 | 153 | scale = 9 - len(fraction) | |
| 154 | - nanos = int(fraction) * (10 ** scale) | ||
| 154 | + nanos = int(fraction) * (10**scale) | ||
| 155 | 155 | micros = nanos // 1000 | |
| 156 | 156 | ||
| 157 | 157 | return bare_seconds.replace(microsecond=micros, tzinfo=datetime.timezone.utc) | |
@@ -245,7 +245,7 @@ def from_rfc3339(cls, stamp): | |||
| 245 | 245 | nanos = 0 | |
| 246 | 246 | else: | |
| 247 | 247 | scale = 9 - len(fraction) | |
| 248 | - nanos = int(fraction) * (10 ** scale) | ||
| 248 | + nanos = int(fraction) * (10**scale) | ||
| 249 | 249 | return cls( | |
| 250 | 250 | bare.year, | |
| 251 | 251 | bare.month, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -202,7 +202,7 @@ def details(self): | |||
| 202 | 202 | ||
| 203 | 203 | Returns: | |
| 204 | 204 | Sequence[Any]: A list of structured objects from error_details.proto | |
| 205 | - """ | ||
| 205 | + """ | ||
| 206 | 206 | return list(self._details) | |
| 207 | 207 | ||
| 208 | 208 | @property | |
@@ -490,7 +490,9 @@ def from_http_response(response): | |||
| 490 | 490 | error_info = error_info[0] if error_info else None | |
| 491 | 491 | ||
| 492 | 492 | message = "{method} {url}: {error}".format( | |
| 493 | - method=response.request.method, url=response.request.url, error=error_message, | ||
| 493 | + method=response.request.method, | ||
| 494 | + url=response.request.url, | ||
| 495 | + error=error_message, | ||
| 494 | 496 | ) | |
| 495 | 497 | ||
| 496 | 498 | exception = from_http_status( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -246,7 +246,9 @@ def _create_composite_credentials( | |||
| 246 | 246 | ||
| 247 | 247 | # Create the metadata plugin for inserting the authorization header. | |
| 248 | 248 | metadata_plugin = google.auth.transport.grpc.AuthMetadataPlugin( | |
| 249 | - credentials, request, default_host=default_host, | ||
| 249 | + credentials, | ||
| 250 | + request, | ||
| 251 | + default_host=default_host, | ||
| 250 | 252 | ) | |
| 251 | 253 | ||
| 252 | 254 | # Create a set of grpc.CallCredentials using the metadata plugin. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,7 +49,8 @@ class AbstractOperationsClientMeta(type): | |||
| 49 | 49 | _transport_registry["rest"] = OperationsRestTransport | |
| 50 | 50 | ||
| 51 | 51 | def get_transport_class( | |
| 52 | - cls, label: Optional[str] = None, | ||
| 52 | + cls, | ||
| 53 | + label: Optional[str] = None, | ||
| 53 | 54 | ) -> Type[OperationsTransport]: | |
| 54 | 55 | """Returns an appropriate transport class. | |
| 55 | 56 | ||
@@ -165,7 +166,9 @@ def transport(self) -> OperationsTransport: | |||
| 165 | 166 | return self._transport | |
| 166 | 167 | ||
| 167 | 168 | @staticmethod | |
| 168 | - def common_billing_account_path(billing_account: str,) -> str: | ||
| 169 | + def common_billing_account_path( | ||
| 170 | + billing_account: str, | ||
| 171 | + ) -> str: | ||
| 169 | 172 | """Returns a fully-qualified billing_account string.""" | |
| 170 | 173 | return "billingAccounts/{billing_account}".format( | |
| 171 | 174 | billing_account=billing_account, | |
@@ -178,9 +181,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: | |||
| 178 | 181 | return m.groupdict() if m else {} | |
| 179 | 182 | ||
| 180 | 183 | @staticmethod | |
| 181 | - def common_folder_path(folder: str,) -> str: | ||
| 184 | + def common_folder_path( | ||
| 185 | + folder: str, | ||
| 186 | + ) -> str: | ||
| 182 | 187 | """Returns a fully-qualified folder string.""" | |
| 183 | - return "folders/{folder}".format(folder=folder,) | ||
| 188 | + return "folders/{folder}".format( | ||
| 189 | + folder=folder, | ||
| 190 | + ) | ||
| 184 | 191 | ||
| 185 | 192 | @staticmethod | |
| 186 | 193 | def parse_common_folder_path(path: str) -> Dict[str, str]: | |
@@ -189,9 +196,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: | |||
| 189 | 196 | return m.groupdict() if m else {} | |
| 190 | 197 | ||
| 191 | 198 | @staticmethod | |
| 192 | - def common_organization_path(organization: str,) -> str: | ||
| 199 | + def common_organization_path( | ||
| 200 | + organization: str, | ||
| 201 | + ) -> str: | ||
| 193 | 202 | """Returns a fully-qualified organization string.""" | |
| 194 | - return "organizations/{organization}".format(organization=organization,) | ||
| 203 | + return "organizations/{organization}".format( | ||
| 204 | + organization=organization, | ||
| 205 | + ) | ||
| 195 | 206 | ||
| 196 | 207 | @staticmethod | |
| 197 | 208 | def parse_common_organization_path(path: str) -> Dict[str, str]: | |
@@ -200,9 +211,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: | |||
| 200 | 211 | return m.groupdict() if m else {} | |
| 201 | 212 | ||
| 202 | 213 | @staticmethod | |
| 203 | - def common_project_path(project: str,) -> str: | ||
| 214 | + def common_project_path( | ||
| 215 | + project: str, | ||
| 216 | + ) -> str: | ||
| 204 | 217 | """Returns a fully-qualified project string.""" | |
| 205 | - return "projects/{project}".format(project=project,) | ||
| 218 | + return "projects/{project}".format( | ||
| 219 | + project=project, | ||
| 220 | + ) | ||
| 206 | 221 | ||
| 207 | 222 | @staticmethod | |
| 208 | 223 | def parse_common_project_path(path: str) -> Dict[str, str]: | |
@@ -211,10 +226,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: | |||
| 211 | 226 | return m.groupdict() if m else {} | |
| 212 | 227 | ||
| 213 | 228 | @staticmethod | |
| 214 | - def common_location_path(project: str, location: str,) -> str: | ||
| 229 | + def common_location_path( | ||
| 230 | + project: str, | ||
| 231 | + location: str, | ||
| 232 | + ) -> str: | ||
| 215 | 233 | """Returns a fully-qualified location string.""" | |
| 216 | 234 | return "projects/{project}/locations/{location}".format( | |
| 217 | - project=project, location=location, | ||
| 235 | + project=project, | ||
| 236 | + location=location, | ||
| 218 | 237 | ) | |
| 219 | 238 | ||
| 220 | 239 | @staticmethod | |
@@ -406,12 +425,20 @@ def list_operations( | |||
| 406 | 425 | ) | |
| 407 | 426 | ||
| 408 | 427 | # Send the request. | |
| 409 | - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) | ||
| 428 | + response = rpc( | ||
| 429 | + request, | ||
| 430 | + retry=retry, | ||
| 431 | + timeout=timeout, | ||
| 432 | + metadata=metadata, | ||
| 433 | + ) | ||
| 410 | 434 | ||
| 411 | 435 | # This method is paged; wrap the response in a pager, which provides | |
| 412 | 436 | # an `__iter__` convenience method. | |
| 413 | 437 | response = pagers.ListOperationsPager( | |
| 414 | - method=rpc, request=request, response=response, metadata=metadata, | ||
| 438 | + method=rpc, | ||
| 439 | + request=request, | ||
| 440 | + response=response, | ||
| 441 | + metadata=metadata, | ||
| 415 | 442 | ) | |
| 416 | 443 | ||
| 417 | 444 | # Done; return the response. | |
@@ -459,7 +486,12 @@ def get_operation( | |||
| 459 | 486 | ) | |
| 460 | 487 | ||
| 461 | 488 | # Send the request. | |
| 462 | - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) | ||
| 489 | + response = rpc( | ||
| 490 | + request, | ||
| 491 | + retry=retry, | ||
| 492 | + timeout=timeout, | ||
| 493 | + metadata=metadata, | ||
| 494 | + ) | ||
| 463 | 495 | ||
| 464 | 496 | # Done; return the response. | |
| 465 | 497 | return response | |
@@ -506,7 +538,10 @@ def delete_operation( | |||
| 506 | 538 | ||
| 507 | 539 | # Send the request. | |
| 508 | 540 | rpc( | |
| 509 | - request, retry=retry, timeout=timeout, metadata=metadata, | ||
| 541 | + request, | ||
| 542 | + retry=retry, | ||
| 543 | + timeout=timeout, | ||
| 544 | + metadata=metadata, | ||
| 510 | 545 | ) | |
| 511 | 546 | ||
| 512 | 547 | def cancel_operation( | |
@@ -560,5 +595,8 @@ def cancel_operation( | |||
| 560 | 595 | ||
| 561 | 596 | # Send the request. | |
| 562 | 597 | rpc( | |
| 563 | - request, retry=retry, timeout=timeout, metadata=metadata, | ||
| 598 | + request, | ||
| 599 | + retry=retry, | ||
| 600 | + timeout=timeout, | ||
| 601 | + metadata=metadata, | ||
| 564 | 602 | ) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -183,9 +183,9 @@ def _prep_wrapped_messages(self, client_info): | |||
| 183 | 183 | def close(self): | |
| 184 | 184 | """Closes resources associated with the transport. | |
| 185 | 185 | ||
| 186 | - .. warning:: | ||
| 187 | - Only call this method if the transport is NOT shared | ||
| 188 | - with other clients - this may cause errors in other clients! | ||
| 186 | + .. warning:: | ||
| 187 | + Only call this method if the transport is NOT shared | ||
| 188 | + with other clients - this may cause errors in other clients! | ||
| 189 | 189 | """ | |
| 190 | 190 | raise NotImplementedError() | |
| 191 | 191 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -239,26 +239,26 @@ def validate(tmpl, path): | |||
| 239 | 239 | ||
| 240 | 240 | def transcode(http_options, **request_kwargs): | |
| 241 | 241 | """Transcodes a grpc request pattern into a proper HTTP request following the rules outlined here, | |
| 242 | - https://github.com/googleapis/googleapis/blob/master/google/api/http.proto#L44-L312 | ||
| 243 | - | ||
| 244 | - Args: | ||
| 245 | - http_options (list(dict)): A list of dicts which consist of these keys, | ||
| 246 | - 'method' (str): The http method | ||
| 247 | - 'uri' (str): The path template | ||
| 248 | - 'body' (str): The body field name (optional) | ||
| 249 | - (This is a simplified representation of the proto option `google.api.http`) | ||
| 250 | - | ||
| 251 | - request_kwargs (dict) : A dict representing the request object | ||
| 252 | - | ||
| 253 | - Returns: | ||
| 254 | - dict: The transcoded request with these keys, | ||
| 255 | - 'method' (str) : The http method | ||
| 256 | - 'uri' (str) : The expanded uri | ||
| 257 | - 'body' (dict) : A dict representing the body (optional) | ||
| 258 | - 'query_params' (dict) : A dict mapping query parameter variables and values | ||
| 259 | - | ||
| 260 | - Raises: | ||
| 261 | - ValueError: If the request does not match the given template. | ||
| 242 | + https://github.com/googleapis/googleapis/blob/master/google/api/http.proto#L44-L312 | ||
| 243 | + | ||
| 244 | + Args: | ||
| 245 | + http_options (list(dict)): A list of dicts which consist of these keys, | ||
| 246 | + 'method' (str): The http method | ||
| 247 | + 'uri' (str): The path template | ||
| 248 | + 'body' (str): The body field name (optional) | ||
| 249 | + (This is a simplified representation of the proto option `google.api.http`) | ||
| 250 | + | ||
| 251 | + request_kwargs (dict) : A dict representing the request object | ||
| 252 | + | ||
| 253 | + Returns: | ||
| 254 | + dict: The transcoded request with these keys, | ||
| 255 | + 'method' (str) : The http method | ||
| 256 | + 'uri' (str) : The expanded uri | ||
| 257 | + 'body' (dict) : A dict representing the body (optional) | ||
| 258 | + 'query_params' (dict) : A dict mapping query parameter variables and values | ||
| 259 | + | ||
| 260 | + Raises: | ||
| 261 | + ValueError: If the request does not match the given template. | ||
| 262 | 262 | """ | |
| 263 | 263 | for http_option in http_options: | |
| 264 | 264 | request = {} | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -48,8 +48,7 @@ def __init__(self, response: requests.Response, response_message_cls): | |||
| 48 | 48 | self._escape_next = False | |
| 49 | 49 | ||
| 50 | 50 | def cancel(self): | |
| 51 | - """Cancel existing streaming operation. | ||
| 52 | - """ | ||
| 51 | + """Cancel existing streaming operation.""" | ||
| 53 | 52 | self._response.close() | |
| 54 | 53 | ||
| 55 | 54 | def _process_chunk(self, chunk: str): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ | |||
| 21 | 21 | import nox # pytype: disable=import-error | |
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | - BLACK_VERSION = "black==19.10b0" | ||
| 24 | + BLACK_VERSION = "black==22.3.0" | ||
| 25 | 25 | BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] | |
| 26 | 26 | # Black and flake8 clash on the syntax for ignoring flake8's F401 in this file. | |
| 27 | 27 | BLACK_EXCLUDES = ["--exclude", "^/google/api_core/operations_v1/__init__.py"] | |
@@ -64,7 +64,10 @@ def lint(session): | |||
| 64 | 64 | session.install("flake8", "flake8-import-order", BLACK_VERSION) | |
| 65 | 65 | session.install(".") | |
| 66 | 66 | session.run( | |
| 67 | - "black", "--check", *BLACK_EXCLUDES, *BLACK_PATHS, | ||
| 67 | + "black", | ||
| 68 | + "--check", | ||
| 69 | + *BLACK_EXCLUDES, | ||
| 70 | + *BLACK_PATHS, | ||
| 68 | 71 | ) | |
| 69 | 72 | session.run("flake8", "google", "tests") | |
| 70 | 73 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments