From 94066d519c5cdfa2dcbf1a100c8aac49f27c849a Mon Sep 17 00:00:00 2001 From: Sheki Lyu Date: Tue, 2 Apr 2019 16:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=9D=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lixinger_openapi/query.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lixinger_openapi/query.py b/lixinger_openapi/query.py index 87ab9db..3d3e3c0 100644 --- a/lixinger_openapi/query.py +++ b/lixinger_openapi/query.py @@ -43,8 +43,10 @@ def query_dataframe(url_suffix, query_params): if rlt is None: return_value['msg'] = 'query failed.' else: - return_value['code'] = rlt['code'] - return_value['msg'] = rlt['msg'] + if 'code' in rlt.keys(): + return_value['code'] = rlt['code'] + if 'msg' in rlt.keys(): + return_value['msg'] = rlt['msg'] if 'data' in rlt.keys(): return_value['data'] = json_normalize(rlt['data']) return return_value