MCPcopy Create free account
hub / github.com/dagger/dagger / parameters

Method parameters

sdk/python/src/dagger/mod/_resolver.py:142–161  ·  view source on GitHub ↗

Return the parameter annotations of the wrapped function. Keys are the Python parameter names.

(self)

Source from the content-addressed store, hash-verified

140
141 @cached_property
142 def parameters(self):
143 """Return the parameter annotations of the wrapped function.
144
145 Keys are the Python parameter names.
146 """
147 mapping: dict[PythonName, Parameter] = {}
148
149 for param in self.signature.parameters.values():
150 # Skip `self` parameter on instance methods.
151 # It will be added manually on `get_result`.
152 if param.name == "self":
153 continue
154
155 if param.kind is inspect.Parameter.POSITIONAL_ONLY:
156 msg = "Positional-only parameters are not supported"
157 raise BadUsageError(msg)
158
159 mapping[param.name] = self._make_parameter(param)
160
161 return mapping
162
163 def _make_parameter(self, param: inspect.Parameter) -> Parameter:
164 """Create a parameter object from an inspect.Parameter."""

Callers 2

functionInvokeMethod · 0.80
withFunctionMethod · 0.80

Calls 3

_make_parameterMethod · 0.95
BadUsageErrorClass · 0.90
valuesMethod · 0.45

Tested by

no test coverage detected