Skip to content

linting #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions google/cloud/spanner_dbapi/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def reason(self):
Returns:
Union[str, None]: An optional string containing reason of the error.
"""
return self.__cause__.reason if self._is_error_cause_instance_of_google_api_exception() else None
return (
self.__cause__.reason
if self._is_error_cause_instance_of_google_api_exception()
else None
)

@property
def domain(self):
Expand All @@ -50,7 +54,11 @@ def domain(self):
Returns:
Union[str, None]: An optional string containing a logical grouping to which the "reason" belongs.
"""
return self.__cause__.domain if self._is_error_cause_instance_of_google_api_exception() else None
return (
self.__cause__.domain
if self._is_error_cause_instance_of_google_api_exception()
else None
)

@property
def metadata(self):
Expand All @@ -60,7 +68,11 @@ def metadata(self):
Returns:
Union[Dict[str, str], None]: An optional object containing structured details about the error.
"""
return self.__cause__.metadata if self._is_error_cause_instance_of_google_api_exception() else None
return (
self.__cause__.metadata
if self._is_error_cause_instance_of_google_api_exception()
else None
)

@property
def details(self):
Expand All @@ -71,7 +83,11 @@ def details(self):
Returns:
Sequence[Any]: A list of structured objects from error_details.proto
"""
return self.__cause__.details if self._is_error_cause_instance_of_google_api_exception() else None
return (
self.__cause__.details
if self._is_error_cause_instance_of_google_api_exception()
else None
)


class InterfaceError(Error):
Expand Down