Manifest_Argument
Manifest_Argument ¶
CodeEngineManifest_Argument
dataclass
¶
CodeEngineManifest_Argument(
annotation_text: str,
has_default_value: bool = None,
ast_arg: arg = None,
schema_type: PythonTypeToSchemaType = None,
is_list: bool = False,
is_nullable: bool = False,
name: str = None,
default_value: str = None,
display_name: str = None,
value: str = None,
children: list[Any] = list(),
)
CodeEngine_Argument
dataclass
¶
CodeEngine_Argument(
annotation_text: str,
has_default_value: bool = None,
ast_arg: arg = None,
schema_type: PythonTypeToSchemaType = None,
is_list: bool = False,
is_nullable: bool = False,
)
converts Python type annotations to Domo CodeEngine argument schema types.
extract_inner_list ¶
extract_inner_list() -> str
Extract the inner element type from list[InnerType] annotations.
Parses list type annotations to determine the type of elements contained within the list, supporting both typing.list and built-in list formats.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
annotation_text
|
str
|
list type annotation (e.g., 'list[str]', 'list[int]') |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The inner type without the list wrapper (e.g., 'str', 'int') |
Examples:
'list[str]' -> 'str' 'list[int]' -> 'int' 'list[dict[str, Any]]' -> 'dict[str, Any]'
Source code in src/crew_dcs/classes/DomoCodeEngine/Manifest_Argument.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 | |
test_is_list_type ¶
test_is_list_type() -> bool
Check if the type annotation represents a list or array type.
Detects various list type patterns including typing.list, built-in list, and generic list annotations from both Python 3.8+ and earlier versions.
Examples:
'list[str]' -> True 'list[int]' -> True 'list' -> True 'str' -> False
Source code in src/crew_dcs/classes/DomoCodeEngine/Manifest_Argument.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | |
test_is_nullable ¶
test_is_nullable() -> str
tests for Optional[] or Union[Type, None] wrappers from type annotation strings.
Examples:
'str | None' -> 'str' 'Union[int, None]' -> 'int' 'Union[None, str]' -> 'str'
Source code in src/crew_dcs/classes/DomoCodeEngine/Manifest_Argument.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
extract_ast_arg_default_value ¶
extract_ast_arg_default_value(
arg, ast_fn: FunctionDef
) -> dict[str, bool]
Extract the default value for a function parameter if it exists.
Note
Handles different AST node types (Constant, Name) and uses ast.unparse() when available for complex expressions.
Source code in src/crew_dcs/classes/DomoCodeEngine/Manifest_Argument.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | |
extract_ast_arg_type_annotation ¶
extract_ast_arg_type_annotation(ast_arg: arg) -> str
Extract type annotation from a function parameter AST node.
Converts AST type annotation nodes back to string representation, handling different Python versions and annotation formats. Falls back to manual parsing for older Python versions without ast.unparse().
Note
Uses ast.unparse() when available (Python 3.9+), otherwise attempts manual extraction for common annotation types like ast.Name and ast.Subscript.
Source code in src/crew_dcs/classes/DomoCodeEngine/Manifest_Argument.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |