Commit 91403bf6 authored by Sarah Abrishami's avatar Sarah Abrishami

debugging problems

parent 7e885258
......@@ -2,14 +2,13 @@ from app.main import main
from app.main.utils.common import response_message, read_data, read_rules, write_validations
from rulemall import RulesGroup
import pandas as pd
from datetime import datetime
@main.route('/validate/<dsid>/<rgid>', methods=['GET', 'POST'])
def validate(dsid, rgid):
configs = read_rules(rgid, where='db')
print('got rules')
rg = RulesGroup()
rg = RulesGroup(rules=[])
rg.from_dict(configs)
# cols = rg.get_target()
data = read_data(dsid)
......@@ -20,9 +19,8 @@ def validate(dsid, rgid):
validation = pd.concat([validation.rename('validated'), responsible], axis=1)
validation = validation.reset_index().rename(columns={'index': 'rid'})
# TODO return rule group id
validation['rgid'] = rgid
validation['dsid'] = dsid
validation['created_date'] = datetime.now()
validation['modified_date'] = datetime.now()
result = write_validations(validation, where='db')
return response_message(result)
# validation['rgid'] = rgid
# validation['dsid'] = dsid
# result = write_validations(validation, where='db')
# return response_message(result)
return response_message(validation.to_dict(orient='records'))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment