(field: "FieldInfo")
| 155 | |
| 156 | |
| 157 | def is_field_noneable(field: "FieldInfo") -> bool: |
| 158 | if getattr(field, "nullable", Undefined) is not Undefined: |
| 159 | return field.nullable # type: ignore |
| 160 | origin = get_origin(field.annotation) |
| 161 | if origin is not None and _is_union_type(origin): |
| 162 | args = get_args(field.annotation) |
| 163 | if any(arg is NoneType for arg in args): |
| 164 | return True |
| 165 | if not field.is_required(): |
| 166 | if field.default is Undefined: |
| 167 | return False |
| 168 | if field.annotation is None or field.annotation is NoneType: |
| 169 | return True |
| 170 | return False |
| 171 | return False |
| 172 | |
| 173 | |
| 174 | def get_sa_type_from_type_annotation(annotation: Any) -> Any: |
no test coverage detected
searching dependent graphs…