destinations.impl.weaviate.weaviate_client
LoadWeaviateJob Objects
class LoadWeaviateJob(RunnableLoadJob)
load_batch
@wrap_weaviate_error
def load_batch(f: IO[str]) -> None
Load all the lines from stream f
in automatic Weaviate batches.
Weaviate batch supports retries so we do not need to do that.
WeaviateClient Objects
class WeaviateClient(JobClientBase, WithStateSync)
Weaviate client implementation.
make_qualified_class_name
def make_qualified_class_name(table_name: str) -> str
Make a full Weaviate class name from a table name by prepending the dataset name if it exists.
get_class_schema
def get_class_schema(table_name: str) -> Dict[str, Any]
Get the Weaviate class schema for a table.
create_class
def create_class(class_schema: Dict[str, Any],
full_class_name: Optional[str] = None) -> None
Create a Weaviate class.
Arguments:
class_schema
- The class schema to create.full_class_name
- The full name of the class to create. If not provided, the class name will be prepended with the dataset name if it exists.
create_class_property
def create_class_property(class_name: str, prop_schema: Dict[str,
Any]) -> None
Create a Weaviate class property.
Arguments:
class_name
- The name of the class to create the property on.prop_schema
- The property schema to create.
delete_class
def delete_class(class_name: str) -> None
Delete a Weaviate class.
Arguments:
class_name
- The name of the class to delete.
delete_all_classes
def delete_all_classes() -> None
Delete all Weaviate classes from Weaviate instance and all data associated with it.
query_class
def query_class(class_name: str, properties: List[str]) -> GetBuilder
Query a Weaviate class.
Arguments:
class_name
- The name of the class to query.properties
- The properties to return.
Returns:
A Weaviate query builder.
create_object
def create_object(obj: Dict[str, Any], class_name: str) -> None
Create a Weaviate object.
Arguments:
obj
- The object to create.class_name
- The name of the class to create the object on.
drop_storage
def drop_storage() -> None
Drop the dataset from Weaviate instance.
Deletes all classes in the dataset and all data associated with them. Deletes the sentinel class as well.
If dataset name was not provided, it deletes all the tables in the current schema
get_stored_state
def get_stored_state(pipeline_name: str) -> Optional[StateInfo]
Loads compressed state from destination storage
get_stored_schema
def get_stored_schema() -> Optional[StorageSchemaInfo]
Retrieves newest schema from destination storage
make_weaviate_class_schema
def make_weaviate_class_schema(table_name: str) -> Dict[str, Any]
Creates a Weaviate class schema from a table schema.