Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 3728024

Browse files
chore: fix line length for code with inline mypy guard (#2554)
Co-authored-by: Daniel Sanche <sanche@google.com>
1 parent 4dd6611 commit 3728024

File tree

12 files changed

+48
-24
lines changed

12 files changed

+48
-24
lines changed

gapic/templates/%namespace/%name_%version/%sub/services/%service/async_client.py.j2

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ class {{ service.async_client_name }}:
9898
Returns:
9999
{{ service.async_client_name }}: The constructed client.
100100
"""
101-
return {{ service.client_name }}.from_service_account_info.__func__({{ service.async_client_name }}, info, *args, **kwargs) # type: ignore
101+
sa_info_func = {{ service.client_name }}.from_service_account_info.__func__ # type: ignore
102+
return sa_info_func({{ service.async_client_name }}, info, *args, **kwargs)
102103

103104
@classmethod
104105
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -114,7 +115,8 @@ class {{ service.async_client_name }}:
114115
Returns:
115116
{{ service.async_client_name }}: The constructed client.
116117
"""
117-
return {{ service.client_name }}.from_service_account_file.__func__({{ service.async_client_name }}, filename, *args, **kwargs) # type: ignore
118+
sa_file_func = {{ service.client_name }}.from_service_account_file.__func__ # type: ignore
119+
return sa_file_func({{ service.async_client_name }}, filename, *args, **kwargs)
118120

119121
from_service_account_json = from_service_account_file
120122

tests/integration/goldens/asset/google/cloud/asset_v1/services/asset_service/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
106106
Returns:
107107
AssetServiceAsyncClient: The constructed client.
108108
"""
109-
return AssetServiceClient.from_service_account_info.__func__(AssetServiceAsyncClient, info, *args, **kwargs) # type: ignore
109+
sa_info_func = AssetServiceClient.from_service_account_info.__func__ # type: ignore
110+
return sa_info_func(AssetServiceAsyncClient, info, *args, **kwargs)
110111

111112
@classmethod
112113
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -122,7 +123,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
122123
Returns:
123124
AssetServiceAsyncClient: The constructed client.
124125
"""
125-
return AssetServiceClient.from_service_account_file.__func__(AssetServiceAsyncClient, filename, *args, **kwargs) # type: ignore
126+
sa_file_func = AssetServiceClient.from_service_account_file.__func__ # type: ignore
127+
return sa_file_func(AssetServiceAsyncClient, filename, *args, **kwargs)
126128

127129
from_service_account_json = from_service_account_file
128130

tests/integration/goldens/credentials/google/iam/credentials_v1/services/iam_credentials/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
9797
Returns:
9898
IAMCredentialsAsyncClient: The constructed client.
9999
"""
100-
return IAMCredentialsClient.from_service_account_info.__func__(IAMCredentialsAsyncClient, info, *args, **kwargs) # type: ignore
100+
sa_info_func = IAMCredentialsClient.from_service_account_info.__func__ # type: ignore
101+
return sa_info_func(IAMCredentialsAsyncClient, info, *args, **kwargs)
101102

102103
@classmethod
103104
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -113,7 +114,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
113114
Returns:
114115
IAMCredentialsAsyncClient: The constructed client.
115116
"""
116-
return IAMCredentialsClient.from_service_account_file.__func__(IAMCredentialsAsyncClient, filename, *args, **kwargs) # type: ignore
117+
sa_file_func = IAMCredentialsClient.from_service_account_file.__func__ # type: ignore
118+
return sa_file_func(IAMCredentialsAsyncClient, filename, *args, **kwargs)
117119

118120
from_service_account_json = from_service_account_file
119121

tests/integration/goldens/eventarc/google/cloud/eventarc_v1/services/eventarc/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
124124
Returns:
125125
EventarcAsyncClient: The constructed client.
126126
"""
127-
return EventarcClient.from_service_account_info.__func__(EventarcAsyncClient, info, *args, **kwargs) # type: ignore
127+
sa_info_func = EventarcClient.from_service_account_info.__func__ # type: ignore
128+
return sa_info_func(EventarcAsyncClient, info, *args, **kwargs)
128129

129130
@classmethod
130131
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -140,7 +141,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
140141
Returns:
141142
EventarcAsyncClient: The constructed client.
142143
"""
143-
return EventarcClient.from_service_account_file.__func__(EventarcAsyncClient, filename, *args, **kwargs) # type: ignore
144+
sa_file_func = EventarcClient.from_service_account_file.__func__ # type: ignore
145+
return sa_file_func(EventarcAsyncClient, filename, *args, **kwargs)
144146

145147
from_service_account_json = from_service_account_file
146148

tests/integration/goldens/logging/google/cloud/logging_v2/services/config_service_v2/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
104104
Returns:
105105
ConfigServiceV2AsyncClient: The constructed client.
106106
"""
107-
return ConfigServiceV2Client.from_service_account_info.__func__(ConfigServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
107+
sa_info_func = ConfigServiceV2Client.from_service_account_info.__func__ # type: ignore
108+
return sa_info_func(ConfigServiceV2AsyncClient, info, *args, **kwargs)
108109

109110
@classmethod
110111
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -120,7 +121,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
120121
Returns:
121122
ConfigServiceV2AsyncClient: The constructed client.
122123
"""
123-
return ConfigServiceV2Client.from_service_account_file.__func__(ConfigServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
124+
sa_file_func = ConfigServiceV2Client.from_service_account_file.__func__ # type: ignore
125+
return sa_file_func(ConfigServiceV2AsyncClient, filename, *args, **kwargs)
124126

125127
from_service_account_json = from_service_account_file
126128

tests/integration/goldens/logging/google/cloud/logging_v2/services/logging_service_v2/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
8989
Returns:
9090
LoggingServiceV2AsyncClient: The constructed client.
9191
"""
92-
return LoggingServiceV2Client.from_service_account_info.__func__(LoggingServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
92+
sa_info_func = LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore
93+
return sa_info_func(LoggingServiceV2AsyncClient, info, *args, **kwargs)
9394

9495
@classmethod
9596
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -105,7 +106,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
105106
Returns:
106107
LoggingServiceV2AsyncClient: The constructed client.
107108
"""
108-
return LoggingServiceV2Client.from_service_account_file.__func__(LoggingServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
109+
sa_file_func = LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore
110+
return sa_file_func(LoggingServiceV2AsyncClient, filename, *args, **kwargs)
109111

110112
from_service_account_json = from_service_account_file
111113

tests/integration/goldens/logging/google/cloud/logging_v2/services/metrics_service_v2/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
9090
Returns:
9191
MetricsServiceV2AsyncClient: The constructed client.
9292
"""
93-
return MetricsServiceV2Client.from_service_account_info.__func__(MetricsServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
93+
sa_info_func = MetricsServiceV2Client.from_service_account_info.__func__ # type: ignore
94+
return sa_info_func(MetricsServiceV2AsyncClient, info, *args, **kwargs)
9495

9596
@classmethod
9697
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -106,7 +107,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
106107
Returns:
107108
MetricsServiceV2AsyncClient: The constructed client.
108109
"""
109-
return MetricsServiceV2Client.from_service_account_file.__func__(MetricsServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
110+
sa_file_func = MetricsServiceV2Client.from_service_account_file.__func__ # type: ignore
111+
return sa_file_func(MetricsServiceV2AsyncClient, filename, *args, **kwargs)
110112

111113
from_service_account_json = from_service_account_file
112114

tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/config_service_v2/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
104104
Returns:
105105
BaseConfigServiceV2AsyncClient: The constructed client.
106106
"""
107-
return BaseConfigServiceV2Client.from_service_account_info.__func__(BaseConfigServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
107+
sa_info_func = BaseConfigServiceV2Client.from_service_account_info.__func__ # type: ignore
108+
return sa_info_func(BaseConfigServiceV2AsyncClient, info, *args, **kwargs)
108109

109110
@classmethod
110111
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -120,7 +121,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
120121
Returns:
121122
BaseConfigServiceV2AsyncClient: The constructed client.
122123
"""
123-
return BaseConfigServiceV2Client.from_service_account_file.__func__(BaseConfigServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
124+
sa_file_func = BaseConfigServiceV2Client.from_service_account_file.__func__ # type: ignore
125+
return sa_file_func(BaseConfigServiceV2AsyncClient, filename, *args, **kwargs)
124126

125127
from_service_account_json = from_service_account_file
126128

tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/logging_service_v2/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
8989
Returns:
9090
LoggingServiceV2AsyncClient: The constructed client.
9191
"""
92-
return LoggingServiceV2Client.from_service_account_info.__func__(LoggingServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
92+
sa_info_func = LoggingServiceV2Client.from_service_account_info.__func__ # type: ignore
93+
return sa_info_func(LoggingServiceV2AsyncClient, info, *args, **kwargs)
9394

9495
@classmethod
9596
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -105,7 +106,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
105106
Returns:
106107
LoggingServiceV2AsyncClient: The constructed client.
107108
"""
108-
return LoggingServiceV2Client.from_service_account_file.__func__(LoggingServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
109+
sa_file_func = LoggingServiceV2Client.from_service_account_file.__func__ # type: ignore
110+
return sa_file_func(LoggingServiceV2AsyncClient, filename, *args, **kwargs)
109111

110112
from_service_account_json = from_service_account_file
111113

tests/integration/goldens/logging_internal/google/cloud/logging_v2/services/metrics_service_v2/async_client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ def from_service_account_info(cls, info: dict, *args, **kwargs):
9090
Returns:
9191
BaseMetricsServiceV2AsyncClient: The constructed client.
9292
"""
93-
return BaseMetricsServiceV2Client.from_service_account_info.__func__(BaseMetricsServiceV2AsyncClient, info, *args, **kwargs) # type: ignore
93+
sa_info_func = BaseMetricsServiceV2Client.from_service_account_info.__func__ # type: ignore
94+
return sa_info_func(BaseMetricsServiceV2AsyncClient, info, *args, **kwargs)
9495

9596
@classmethod
9697
def from_service_account_file(cls, filename: str, *args, **kwargs):
@@ -106,7 +107,8 @@ def from_service_account_file(cls, filename: str, *args, **kwargs):
106107
Returns:
107108
BaseMetricsServiceV2AsyncClient: The constructed client.
108109
"""
109-
return BaseMetricsServiceV2Client.from_service_account_file.__func__(BaseMetricsServiceV2AsyncClient, filename, *args, **kwargs) # type: ignore
110+
sa_file_func = BaseMetricsServiceV2Client.from_service_account_file.__func__ # type: ignore
111+
return sa_file_func(BaseMetricsServiceV2AsyncClient, filename, *args, **kwargs)
110112

111113
from_service_account_json = from_service_account_file
112114

0 commit comments

Comments
 (0)