Ejemplo n.º 1
0
def test_feedback_inserted(sample_feedback):
    """Test inserting events into the fact_store."""
    fact_store = FactStore(True)
    fact_store.session.query(FeedbackModel).delete()
    for feedback in sample_feedback:
        fact_store.write_feedback(**feedback)
    items = fact_store.readall_feedback()
    assert len(items) is 3
Ejemplo n.º 2
0
def test_feedback_inserted():
    """Test inserting events into the fact_store."""
    CUSTOMER_ID = "#123456"
    fact_store = FactStore(True)
    fact_store.session.query(FeedbackModel).delete()
    fact_store.write_feedback(
        predict_id="a2b35c5b-016d-4e2c-8ec5-87d1b962b2f8", message="222JSJSJJS",
        anomaly_status=True, customer_id=CUSTOMER_ID
    )
    fact_store.write_feedback(predict_id="18bd090d-ae27-4b19-a0db-ed5f589b4e2e",
                              customer_id=CUSTOMER_ID, message="SSJJSJS", anomaly_status=True)
    fact_store.write_feedback(predict_id="74a6b1bd-efea-4e7b-87a9-8f7330885160", message="AJJSJS",
                              customer_id=CUSTOMER_ID, anomaly_status=False)
    items = fact_store.readall_feedback()
    assert len(items) is 3
Ejemplo n.º 3
0
def metadata():
    """Service to provide list of false anomalies to be relabeled during ml training run."""
    fs = FactStore()
    df = fs.readall_feedback()
    return jsonify({"feedback": df})