def delete_milvus_collections_by_fields(app): for _, field in app['fields'].items(): if field["type"] == "pipeline": pipe = MongoIns.search_by_name(PIPELINE_COLLECTION_NAME, field.get("value"))[0] name = f"{app.get('name')}_{pipe.get('encoder').get('instance').get('name').replace('phantoscope_', '')}" MilvusIns.del_milvus_collection(name)
def delete_milvus_collections_by_fields(app): for _, field in app.fields.items(): if field["type"] == "pipeline": pipe = pipeline_detail(field["value"]) name = pipe.encoder.get("name") instance_name = pipe.encoder.get("instance") MilvusIns.del_milvus_collection( f"{app.name}_{name}_{instance_name}")
def delete_pipeline(name): try: p = del_pipeline(name) if not p: raise NotExistError("pipeline %s is not exist" % name, "") p = p[0] milvus_collection_name = f"{name}_{p.encoder}" MilvusIns.del_milvus_collection(milvus_collection_name) pipe = Pipeline(name=p.name, input=p.input, output=p.output, dimension=p.dimension, index_file_size=p.index_file_size, metric_type=p.metric_type, description=p.description, processors=p.processors.split(","), encoder=p.encoder) return pipe except Exception as e: logger.error(e) return e
def test_del_milvus_collection(self): """drop collection""" rv = MilvusIns.del_milvus_collection(self.name) assert rv == None