|
1 | 1 | from collections.abc import Callable |
2 | 2 | from typing import TYPE_CHECKING, cast |
3 | 3 |
|
4 | | -from mindee.parsing.common import StringDict |
| 4 | +from mindee.parsing.common.string_dict import StringDict |
5 | 5 | from mindee.v2.parsing.inference.field.base_field import BaseField, FieldType |
6 | 6 | from mindee.v2.parsing.inference.field.inference_fields import InferenceFields |
7 | 7 |
|
@@ -51,7 +51,7 @@ def simple_fields(self) -> dict[str, "SimpleField"]: |
51 | 51 | Extract and return all SimpleField fields from the `fields` attribute. |
52 | 52 |
|
53 | 53 | :return: A dictionary containing all fields that have a type of |
54 | | - `FieldType.SIMPLE`. |
| 54 | + `FieldType.SIMPLE`. |
55 | 55 | """ |
56 | 56 | simple_fields = {} |
57 | 57 | for field_key, field_value in self.fields.items(): |
@@ -80,8 +80,8 @@ def object_fields(self) -> dict[str, "ObjectField"]: |
80 | 80 | Retrieves all ObjectField fields from the `fields` attribute of the instance. |
81 | 81 |
|
82 | 82 | :returns: A dictionary containing fields of type `FieldType.OBJECT`. The keys |
83 | | - represent |
84 | | - the field names, and the values are corresponding ObjectField objects. |
| 83 | + represent the field names, and the values are corresponding ObjectField |
| 84 | + objects. |
85 | 85 | """ |
86 | 86 | object_fields = {} |
87 | 87 | for field_key, field_value in self.fields.items(): |
@@ -123,7 +123,7 @@ def get_object_field(self, field_name: str) -> "ObjectField": |
123 | 123 | :type field_name: str |
124 | 124 | :return: The `ObjectField` associated with the given field name. |
125 | 125 | :raises ValueError: If the field specified by `field_name` is not an |
126 | | - `ObjectField`. |
| 126 | + `ObjectField`. |
127 | 127 | """ |
128 | 128 | if self.fields[field_name].field_type != FieldType.OBJECT: |
129 | 129 | raise ValueError(f"Field {field_name} is not an ObjectField.") |
|
0 commit comments