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

Commit a0869e5

Browse files
committed
fix lint
1 parent 5d00800 commit a0869e5

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

gapic/schema/imp.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,16 @@ def __str__(self) -> str:
3131
# internals where type information might be missing or incomplete.
3232
needs_type_ignore = self.module.endswith("_pb2") or "api_core" in self.package
3333
if not needs_type_ignore:
34-
# Standard import generation
35-
answer = f"import {self.module}"
36-
if self.package:
37-
answer = f"from {'.'.join(self.package)} {answer}"
38-
if self.alias:
39-
answer += f" as {self.alias}"
40-
return answer
41-
else:
4234
# Use 'import absolute.path as module' syntax to prevent Ruff/isort
4335
# from combining this with other imports. This ensures the
4436
# '# type: ignore' comment remains effective for this specific import.
4537
full_module = ".".join(self.package + (self.module,))
4638
alias = self.alias or self.module
4739
return f"import {full_module} as {alias} # type: ignore"
4840

41+
answer = f"import {self.module}"
42+
if self.package:
43+
answer = f"from {'.'.join(self.package)} {answer}"
44+
if self.alias:
45+
answer += f" as {self.alias}"
46+
return answer

0 commit comments

Comments
 (0)