[go: nahoru, domu]

Skip to content

Commit

Permalink
Updated the Validation with individual code
Browse files Browse the repository at this point in the history
  • Loading branch information
KshitijPhulare committed Apr 20, 2022
1 parent e8bf20b commit 7b9547e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions experimental/Validation/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_values(documentlabel,cid,uid,entity):
get_scoring(data,merge_query,documentlabel,entity)
Logger.info(f"Validation completed for document with case id {cid}"
f"and uid {uid}")
except Exception as e:
except (Exception,) as e:
Logger.error(e)
validation_score = None
return validation_score
Expand Down Expand Up @@ -109,7 +109,7 @@ def get_scoring(data,merge_query,documentlabel,entity):
try:
query_results = bigquery_client.query((query))
df = query_results.to_dataframe()
except Exception as e:
except (Exception,) as e:
Logger.error(e)
df = pd.DataFrame()
df = df.drop_duplicates()
Expand Down
4 changes: 2 additions & 2 deletions microservices/validation_service/src/routes/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
router = APIRouter(prefix="/validation")
SUCCESS_RESPONSE = {"status": "Success"}
FAILED_RESPONSE = {"status": "Failed"}

entity=[]

@router.post("/validation_api")
async def validation(case_id: str, uid: str, doc_class: str):
Expand All @@ -25,7 +25,7 @@ async def validation(case_id: str, uid: str, doc_class: str):
"""
status = "fail"
try:
validation_score = get_values(doc_class, case_id, uid)
validation_score = get_values(doc_class, case_id, uid,entity)
if validation_score is not None:
status = "success"
update_validation_status(case_id, uid, validation_score, status)
Expand Down
4 changes: 2 additions & 2 deletions microservices/validation_service/src/utils/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_values(documentlabel,cid,uid,entity):
get_scoring(data,merge_query,documentlabel,entity)
Logger.info(f"Validation completed for document with case id {cid}"
f"and uid {uid}")
except Exception as e:
except (Exception,) as e:
Logger.error(e)
validation_score = None
return validation_score
Expand Down Expand Up @@ -109,7 +109,7 @@ def get_scoring(data,merge_query,documentlabel,entity):
try:
query_results = bigquery_client.query((query))
df = query_results.to_dataframe()
except Exception as e:
except (Exception,) as e:
Logger.error(e)
df = pd.DataFrame()
df = df.drop_duplicates()
Expand Down

0 comments on commit 7b9547e

Please sign in to comment.