yqkcn
commited on
Commit
·
104ee20
1
Parent(s):
57bca82
remove redeclared get_json_result func (#2675)
Browse files### What problem does this PR solve?
Redeclared 'get_json_result' defined above without usage
line 99 VS line 218
### Type of change
- [x] Other (please describe): remove redeclared func
- api/utils/api_utils.py +0 -20
api/utils/api_utils.py
CHANGED
@@ -96,26 +96,6 @@ def get_exponential_backoff_interval(retries, full_jitter=False):
|
|
96 |
return max(0, countdown)
|
97 |
|
98 |
|
99 |
-
def get_json_result(retcode=RetCode.SUCCESS, retmsg='success',
|
100 |
-
data=None, job_id=None, meta=None):
|
101 |
-
result_dict = {
|
102 |
-
"retcode": retcode,
|
103 |
-
"retmsg": retmsg,
|
104 |
-
# "retmsg": re.sub(r"rag", "seceum", retmsg, flags=re.IGNORECASE),
|
105 |
-
"data": data,
|
106 |
-
"jobId": job_id,
|
107 |
-
"meta": meta,
|
108 |
-
}
|
109 |
-
|
110 |
-
response = {}
|
111 |
-
for key, value in result_dict.items():
|
112 |
-
if value is None and key != "retcode":
|
113 |
-
continue
|
114 |
-
else:
|
115 |
-
response[key] = value
|
116 |
-
return jsonify(response)
|
117 |
-
|
118 |
-
|
119 |
def get_data_error_result(retcode=RetCode.DATA_ERROR,
|
120 |
retmsg='Sorry! Data missing!'):
|
121 |
import re
|
|
|
96 |
return max(0, countdown)
|
97 |
|
98 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
99 |
def get_data_error_result(retcode=RetCode.DATA_ERROR,
|
100 |
retmsg='Sorry! Data missing!'):
|
101 |
import re
|