Commit ed769b35 by 柴鹏飞

修复部分画像字段为空导致的错误

parent db437f1c
...@@ -9,3 +9,4 @@ requests ...@@ -9,3 +9,4 @@ requests
tornado==6.2 tornado==6.2
scikit-learn scikit-learn
requests
...@@ -217,7 +217,10 @@ class AidiCstBiasPriceProfile(BaseProfile): ...@@ -217,7 +217,10 @@ class AidiCstBiasPriceProfile(BaseProfile):
if pd.isnull(value): if pd.isnull(value):
return ret return ret
try:
json_object = json.loads(value) json_object = json.loads(value)
except Exception:
return ret
for v in json_object: for v in json_object:
try: try:
...@@ -250,13 +253,16 @@ class MultiChoiceProfile(BaseProfile): ...@@ -250,13 +253,16 @@ class MultiChoiceProfile(BaseProfile):
if pd.isnull(value): if pd.isnull(value):
return ret return ret
try:
value = json.loads(value) value = json.loads(value)
except Exception:
return ret
for v in value: for v in value:
try: try:
i = self.option_dict[v] i = self.option_dict[v]
ret[i] = 1 ret[i] = 1
except Exception as e: except Exception:
pass pass
return ret return ret
......
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