(self, key: Union[int, str])
| 150 | return self.input_attribute_nodes[key] |
| 151 | |
| 152 | def __getitem__(self, key: Union[int, str]) -> Any: |
| 153 | assert isinstance(key, (str, int)), ( |
| 154 | "Please only use int index or str as first-level key to " |
| 155 | "access fields of dag input." |
| 156 | ) |
| 157 | |
| 158 | input_type = None |
| 159 | if self.input_type is not None and key in self.input_type: |
| 160 | input_type = type_to_string(self.input_type[key]) |
| 161 | |
| 162 | if key not in self.input_attribute_nodes: |
| 163 | self.input_attribute_nodes[key] = InputAttributeNode( |
| 164 | self, key, "__getitem__", input_type |
| 165 | ) |
| 166 | return self.input_attribute_nodes[key] |
| 167 | |
| 168 | def __enter__(self): |
| 169 | self.set_context(IN_CONTEXT_MANAGER, True) |
no test coverage detected