Skip to content

Commit 8bd2db2

Browse files
committed
linting
1 parent b4466be commit 8bd2db2

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

google/cloud/spanner_dbapi/exceptions.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ def reason(self):
4040
Returns:
4141
Union[str, None]: An optional string containing reason of the error.
4242
"""
43-
return self.__cause__.reason if self._is_error_cause_instance_of_google_api_exception() else None
43+
return (
44+
self.__cause__.reason
45+
if self._is_error_cause_instance_of_google_api_exception()
46+
else None
47+
)
4448

4549
@property
4650
def domain(self):
@@ -50,7 +54,11 @@ def domain(self):
5054
Returns:
5155
Union[str, None]: An optional string containing a logical grouping to which the "reason" belongs.
5256
"""
53-
return self.__cause__.domain if self._is_error_cause_instance_of_google_api_exception() else None
57+
return (
58+
self.__cause__.domain
59+
if self._is_error_cause_instance_of_google_api_exception()
60+
else None
61+
)
5462

5563
@property
5664
def metadata(self):
@@ -60,7 +68,11 @@ def metadata(self):
6068
Returns:
6169
Union[Dict[str, str], None]: An optional object containing structured details about the error.
6270
"""
63-
return self.__cause__.metadata if self._is_error_cause_instance_of_google_api_exception() else None
71+
return (
72+
self.__cause__.metadata
73+
if self._is_error_cause_instance_of_google_api_exception()
74+
else None
75+
)
6476

6577
@property
6678
def details(self):
@@ -71,7 +83,11 @@ def details(self):
7183
Returns:
7284
Sequence[Any]: A list of structured objects from error_details.proto
7385
"""
74-
return self.__cause__.details if self._is_error_cause_instance_of_google_api_exception() else None
86+
return (
87+
self.__cause__.details
88+
if self._is_error_cause_instance_of_google_api_exception()
89+
else None
90+
)
7591

7692

7793
class InterfaceError(Error):

0 commit comments

Comments
 (0)