|
18 | 18 | import copy |
19 | 19 | import datetime |
20 | 20 | import json |
21 | | -from typing import Any, Optional, Set, Tuple, Union |
22 | 21 | import warnings |
| 22 | +from typing import Any, Optional, Set, Tuple, Union, TYPE_CHECKING |
23 | 23 | from urllib.parse import urlsplit |
24 | 24 |
|
25 | 25 | from google.api_core import datetime_helpers |
26 | 26 | from google.api_core.iam import Policy |
27 | 27 | from google.api_core.retry import Retry |
28 | 28 | from google.cloud._helpers import _datetime_to_rfc3339, _rfc3339_nanos_to_datetime |
29 | 29 | from google.cloud.exceptions import NotFound |
30 | | - |
31 | | -from google.cloud.storage import Client, _signing |
| 30 | +from google.cloud.storage import _signing |
32 | 31 | from google.cloud.storage._helpers import ( |
33 | 32 | _NOW, |
34 | 33 | _UTC, |
|
70 | 69 | ConditionalRetryPolicy, |
71 | 70 | ) |
72 | 71 |
|
| 72 | +if TYPE_CHECKING: |
| 73 | + from google.cloud.storage.client import Client |
| 74 | + |
73 | 75 | _UBLA_BPO_ENABLED_MESSAGE = ( |
74 | 76 | "Pass only one of 'uniform_bucket_level_access_enabled' / " |
75 | 77 | "'bucket_policy_only_enabled' to 'IAMConfiguration'." |
@@ -854,7 +856,7 @@ def blob( |
854 | 856 | encryption_key: Optional[bytes] = None, |
855 | 857 | kms_key_name: Optional[str] = None, |
856 | 858 | generation: Optional[int] = None, |
857 | | - ) -> Blob: |
| 859 | + ) -> "Blob": |
858 | 860 | """Factory constructor for blob object. |
859 | 861 |
|
860 | 862 | .. note:: |
@@ -1295,7 +1297,7 @@ def path(self): |
1295 | 1297 | def get_blob( |
1296 | 1298 | self, |
1297 | 1299 | blob_name: str, |
1298 | | - client: Optional[Client] = None, |
| 1300 | + client: Optional["Client"] = None, |
1299 | 1301 | encryption_key: Optional[bytes] = None, |
1300 | 1302 | generation: Optional[int] = None, |
1301 | 1303 | if_etag_match: Optional[Union[str, Set[str]]] = None, |
|
0 commit comments