pydantic
¤
Modules:
-
builder
– -
error
– -
type_checker
– -
warning
– -
warning_manager
–
Classes:
-
DeeplyNestedStructureError
–Exception raised when encountering unsupported deeply nested structures.
-
FlureeSelectBuilder
–Builds Fluree select queries from Pydantic models.
-
FlureeSelectError
–Base exception for Fluree select query building errors.
-
InvalidFieldTypeError
–Exception raised when encountering an invalid field type.
-
ListOrderWarning
–Warning raised when a field is a list type, indicating non-deterministic order.
-
MissingIdFieldError
–Exception raised when a model is missing a required 'id' field.
-
ModelConfigError
–Exception raised when there's an issue with the model configuration.
-
PossibleEmptyModelWarning
–Warning raised when a model has only optional fields.
-
TypeProcessingError
–Exception raised when there's an error processing a type.
Functions:
-
from_pydantic
–Convert a Pydantic model to a Fluree select query structure.
DeeplyNestedStructureError
¤
Bases: FlureeSelectError
Exception raised when encountering unsupported deeply nested structures.
FlureeSelectBuilder
dataclass
¤
FlureeSelectBuilder(
warning_manager: WarningManager = WarningManager(),
select: list[Any] = lambda: ["*"](),
_processed_models: set[type[BaseModel]] = set(),
)
Builds Fluree select queries from Pydantic models.
Example
class User(BaseModel):
... id: str
... name: str
builder = FlureeSelectBuilder()
query = builder.build(User)
assert query == ["*"]
Methods:
-
build
–Build a Fluree select query structure from a Pydantic model.
build
¤
Build a Fluree select query structure from a Pydantic model.
Raises:
-
MissingIdFieldError
–If the model is missing a required 'id' field
-
DeeplyNestedStructureError
–If the model contains unsupported deeply nested structures
-
ModelConfigError
–If there's an issue with the model configuration
InvalidFieldTypeError
¤
Bases: FlureeSelectError
Exception raised when encountering an invalid field type.
ListOrderWarning
¤
Bases: RuntimeWarning
Warning raised when a field is a list type, indicating non-deterministic order.
MissingIdFieldError
¤
Bases: FlureeSelectError
Exception raised when a model is missing a required 'id' field.
ModelConfigError
¤
Bases: FlureeSelectError
Exception raised when there's an issue with the model configuration.
PossibleEmptyModelWarning
¤
Bases: RuntimeWarning
Warning raised when a model has only optional fields.
TypeProcessingError
¤
Bases: FlureeSelectError
Exception raised when there's an error processing a type.