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

Commit 46fb386

Browse files
committed
no context
1 parent 58f3049 commit 46fb386

3 files changed

Lines changed: 10 additions & 14 deletions

File tree

gapic/schema/api.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ def proto(self) -> Proto:
12351235
return dataclasses.replace(
12361236
naive,
12371237
all_enums=collections.OrderedDict(
1238-
(k, v.with_context(collisions=global_collisions, context_cache=self.context_cache))
1238+
(k, v.with_context(collisions=global_collisions))
12391239
for k, v in naive.all_enums.items()
12401240
),
12411241
all_messages=collections.OrderedDict(
@@ -1244,7 +1244,6 @@ def proto(self) -> Proto:
12441244
v.with_context(
12451245
collisions=global_collisions,
12461246
visited_messages=visited_messages,
1247-
context_cache=self.context_cache,
12481247
),
12491248
)
12501249
for k, v in naive.all_messages.items()
@@ -1257,12 +1256,11 @@ def proto(self) -> Proto:
12571256
v.with_context(
12581257
collisions=global_collisions,
12591258
visited_messages=visited_messages,
1260-
context_cache=self.context_cache,
12611259
),
12621260
)
12631261
for k, v in naive.services.items()
12641262
),
1265-
meta=naive.meta.with_context(collisions=naive.names, context_cache=self.context_cache),
1263+
meta=naive.meta.with_context(collisions=naive.names),
12661264
)
12671265

12681266
@cached_property

gapic/schema/metadata.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,7 @@ def resolve(self, selector: str) -> str:
360360
return f'{".".join(self.package)}.{selector}'
361361
return selector
362362

363-
@cached_proto_context
364-
def with_context(self, *, collisions: Set[str], context_cache: Optional[Dict] = None) -> "Address":
363+
def with_context(self, *, collisions: Set[str]) -> "Address":
365364
"""Return a derivative of this address with the provided context.
366365
367366
This method is used to address naming collisions. The returned
@@ -400,8 +399,7 @@ def doc(self):
400399
return "\n\n".join(self.documentation.leading_detached_comments)
401400
return ""
402401

403-
@cached_proto_context
404-
def with_context(self, *, collisions: Set[str], context_cache: Optional[Dict] = None) -> "Metadata":
402+
def with_context(self, *, collisions: Set[str]) -> "Metadata":
405403
"""Return a derivative of this metadata with the provided context.
406404
407405
This method is used to address naming collisions. The returned
@@ -411,7 +409,7 @@ def with_context(self, *, collisions: Set[str], context_cache: Optional[Dict] =
411409
return (
412410
dataclasses.replace(
413411
self,
414-
address=self.address.with_context(collisions=collisions, context_cache=context_cache),
412+
address=self.address.with_context(collisions=collisions),
415413
)
416414
if collisions and collisions != self.address.collisions
417415
else self

gapic/schema/wrappers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def with_context(
440440
else None
441441
),
442442
enum=self.enum.with_context(collisions=collisions, context_cache=context_cache) if self.enum else None,
443-
meta=self.meta.with_context(collisions=collisions, context_cache=context_cache),
443+
meta=self.meta.with_context(collisions=collisions),
444444
)
445445

446446
def add_to_address_allowlist(
@@ -856,7 +856,7 @@ def with_context(
856856
)
857857
for k, v in self.nested_messages.items()
858858
},
859-
meta=self.meta.with_context(collisions=collisions, context_cache=context_cache),
859+
meta=self.meta.with_context(collisions=collisions),
860860
)
861861

862862
def add_to_address_allowlist(
@@ -956,7 +956,7 @@ def with_context(self, *, collisions: Set[str], context_cache: Optional[Dict] =
956956
return (
957957
dataclasses.replace(
958958
self,
959-
meta=self.meta.with_context(collisions=collisions, context_cache=context_cache),
959+
meta=self.meta.with_context(collisions=collisions),
960960
)
961961
if collisions
962962
else self
@@ -2004,7 +2004,7 @@ def with_context(
20042004
visited_messages=visited_messages,
20052005
context_cache=context_cache
20062006
),
2007-
meta=self.meta.with_context(collisions=collisions, context_cache=context_cache),
2007+
meta=self.meta.with_context(collisions=collisions),
20082008
)
20092009

20102010
def add_to_address_allowlist(
@@ -2406,7 +2406,7 @@ def with_context(
24062406
)
24072407
for k, v in self.methods.items()
24082408
},
2409-
meta=self.meta.with_context(collisions=collisions, context_cache=context_cache),
2409+
meta=self.meta.with_context(collisions=collisions),
24102410
)
24112411

24122412
def add_to_address_allowlist(

0 commit comments

Comments
 (0)