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

Commit 401320e

Browse files
committed
revert wrappers
1 parent 66bf9ec commit 401320e

File tree

1 file changed

+8
-21
lines changed

1 file changed

+8
-21
lines changed

gapic/schema/wrappers.py

Lines changed: 8 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@
6767

6868
from gapic import utils
6969
from gapic.schema import metadata
70+
from gapic.utils import cached_proto_context
7071
from gapic.utils import uri_sample
7172
from gapic.utils import make_private
72-
from gapic.utils import cached_proto_context
7373

7474

7575
@dataclasses.dataclass(frozen=True)
@@ -437,10 +437,8 @@ def with_context(
437437
if self.message
438438
else None
439439
),
440-
enum=(self.enum.with_context(collisions=collisions) if self.enum else None),
441-
meta=self.meta.with_context(
442-
collisions=collisions,
443-
),
440+
enum=self.enum.with_context(collisions=collisions) if self.enum else None,
441+
meta=self.meta.with_context(collisions=collisions),
444442
)
445443

446444
def add_to_address_allowlist(
@@ -741,9 +739,7 @@ def path_regex_str(self) -> str:
741739
return parsing_regex_str
742740

743741
def get_field(
744-
self,
745-
*field_path: str,
746-
collisions: Optional[Set[str]] = None,
742+
self, *field_path: str, collisions: Optional[Set[str]] = None
747743
) -> Field:
748744
"""Return a field arbitrarily deep in this message's structure.
749745
@@ -836,8 +832,7 @@ def with_context(
836832
fields=(
837833
{
838834
k: v.with_context(
839-
collisions=collisions,
840-
visited_messages=visited_messages,
835+
collisions=collisions, visited_messages=visited_messages
841836
)
842837
for k, v in self.fields.items()
843838
}
@@ -946,11 +941,7 @@ def ident(self) -> metadata.Address:
946941
return self.meta.address
947942

948943
@cached_proto_context
949-
def with_context(
950-
self,
951-
*,
952-
collisions: Set[str],
953-
) -> "EnumType":
944+
def with_context(self, *, collisions: Set[str]) -> "EnumType":
954945
"""Return a derivative of this enum with the provided context.
955946
956947
This method is used to address naming collisions. The returned
@@ -1997,9 +1988,7 @@ def with_context(
19971988
collisions=collisions,
19981989
visited_messages=visited_messages,
19991990
),
2000-
meta=self.meta.with_context(
2001-
collisions=collisions,
2002-
),
1991+
meta=self.meta.with_context(collisions=collisions),
20031992
)
20041993

20051994
def add_to_address_allowlist(
@@ -2399,9 +2388,7 @@ def with_context(
23992388
)
24002389
for k, v in self.methods.items()
24012390
},
2402-
meta=self.meta.with_context(
2403-
collisions=collisions,
2404-
),
2391+
meta=self.meta.with_context(collisions=collisions),
24052392
)
24062393

24072394
def add_to_address_allowlist(

0 commit comments

Comments
 (0)