mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-11 05:49:22 +00:00
feat: (0.6)New UI (#1855)
Co-authored-by: 夏姜 <wenfengjiang.jwf@digital-engine.com> Co-authored-by: aries_ckt <916701291@qq.com> Co-authored-by: wb-lh513319 <wb-lh513319@alibaba-inc.com> Co-authored-by: csunny <cfqsunny@163.com>
This commit is contained in:
@@ -117,3 +117,28 @@ def _format_json_str(jstr):
|
||||
char = "\\t"
|
||||
result.append(char)
|
||||
return "".join(result)
|
||||
|
||||
|
||||
def compare_json_properties(json1, json2):
|
||||
"""
|
||||
Check whether the attributes of two json are consistent
|
||||
"""
|
||||
obj1 = json.loads(json1)
|
||||
obj2 = json.loads(json2)
|
||||
|
||||
# 检查两个对象的键集合是否相同
|
||||
if set(obj1.keys()) == set(obj2.keys()):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def compare_json_properties_ex(json1, json2):
|
||||
"""
|
||||
Check whether the attributes of two json are consistent
|
||||
"""
|
||||
# 检查两个对象的键集合是否相同
|
||||
if set(json1.keys()) == set(json2.keys()):
|
||||
return True
|
||||
|
||||
return False
|
||||
|
Reference in New Issue
Block a user