MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / _handle_placeholders

Method _handle_placeholders

test/unified_format.py:252–267  ·  view source on GitHub ↗
(self, spec: dict, current: dict, path: str)

Source from the content-addressed store, hash-verified

250 self._entities[key] = value
251
252 def _handle_placeholders(self, spec: dict, current: dict, path: str) -> Any:
253 if "$$placeholder" in current:
254 if path not in PLACEHOLDER_MAP:
255 raise ValueError(f"Could not find a placeholder value for {path}")
256 return PLACEHOLDER_MAP[path]
257
258 # Distinguish between temp and non-temp aws credentials.
259 if path.endswith("/kmsProviders/aws") and "sessionToken" in current:
260 path = path.replace("aws", "aws_temp")
261
262 for key in list(current):
263 value = current[key]
264 if isinstance(value, dict):
265 subpath = f"{path}/{key}"
266 current[key] = self._handle_placeholders(spec, value, subpath)
267 return current
268
269 def _create_entity(self, entity_spec, uri=None):
270 if len(entity_spec) != 1:

Callers 1

_create_entityMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected