diff --git a/src/databricks/labs/blueprint/cli.py b/src/databricks/labs/blueprint/cli.py index 7c15908..2060374 100644 --- a/src/databricks/labs/blueprint/cli.py +++ b/src/databricks/labs/blueprint/cli.py @@ -36,9 +36,11 @@ def prompts_argument_name(self) -> str | None: return param.name return None - def get_argument_type(self, argument_name: str) -> type: + def get_argument_type(self, argument_name: str) -> str | None: sig = inspect.signature(self.fn) - return sig.parameters[argument_name].annotation + if argument_name not in sig.parameters: + return None + return sig.parameters[argument_name].annotation.__name__ class App: @@ -85,7 +87,7 @@ def _route(self, raw): cmd = self._mapping[command] # modify kwargs to match the type of the argument for kwarg in list(kwargs.keys()): - match cmd.get_argument_type(kwarg).__name__: + match cmd.get_argument_type(kwarg): case "int": kwargs[kwarg] = int(kwargs[kwarg]) case "bool":