Brain Docs

Reference

Python SDKInstallationHTTP clientWire clientSync vs async
get_schemavalidate_schemaupload_schemareplace_schemadrop_schemalist_schemaslist_extractors
ErrorsRetriesPagination
Brain/Docs
✦ ASKBrain on GitHubDashboard
Python SDKSchemadrop_schema

drop_schema

Remove one declaration — and find out how many live rows still depend on it.

PURPOSE

Remove one declaration — an entity type, a predicate, a relation type — rather than the whole document.

DELETE/v1/schema/:kind/:nameBearer API keystable
drop_schema(kind: str, name: str, force: bool = False) -> DropSchemaResult
Handshake credentialstable
drop_schema(request: SchemaDropRequest) -> SchemaDropResponse

Parameters

ParameterTypeRequired
kindstringrequired

What is being dropped. A path segment on the HTTP tier.

namestringrequired

Its name. Also a path segment.

forcebooleanoptional

Drop it even though rows still use it.

Returns

FieldTypePresence
droppedbooleanalways

Whether it was removed. false with a non-zero liveRows is the refusal: rows still use the declaration and force was not set.

live_rowsintegeralways

How many rows depend on it. Check this before retrying with force — it is the number of rows that retry would orphan.

namespace / schema_version / target_kind / target_name—always

What was targeted.

validation_errorsSchemaError[]always

Populated when the drop would leave the schema invalid.

Validation failures are not exceptions

This verb resolves with a populated validationErrors array rather than throwing. Code that only wraps the call in a try/catch treats an invalid schema as a successful one. Check the array.

See also
replace_schemaget_schema

Was this page helpful?

replace_schema

Replace the schema wholesale — and read the count of live rows it destroyed.

list_schemas

Every schema version in the namespace, and whether each one kept its source text.

On this page

ParametersReturns
Suggest an editOpen in Playground