Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

"""Google Cloud Translation API wrapper."""


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Removing this extra blank line improves code formatting and adheres to common Python style guides that discourage excessive blank lines.

Suggested change
from google.cloud.translate import __version__

from google.cloud.translate import __version__
from google.cloud.translate_v2.client import Client

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

"""Client for interacting with the Google Cloud Translation API."""


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Removing this extra blank line improves code formatting and adheres to common Python style guides that discourage excessive blank lines.

Suggested change
import google.api_core.client_options

import google.api_core.client_options
from google.cloud.client import Client as BaseClient

Expand Down Expand Up @@ -174,9 +173,9 @@ def detect_language(self, values):
if len(detections[index]) == 1:
detections[index] = detections[index][0]
else:
message = (
"Expected a single detection per value, API " "returned %d"
) % (len(detections[index]),)
message = ("Expected a single detection per value, API returned %d") % (
len(detections[index]),
)
raise ValueError(message, value, detections[index])
Comment on lines +177 to 179
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The reformatting of the message string improves readability by consolidating it into a single line, which is generally preferred for short strings unless multi-line formatting significantly enhances clarity.

                message = ("Expected a single detection per value, API returned %d") % (len(detections[index]),)


detections[index]["input"] = value
Expand Down
Loading