pyTigergraph Issue

Hi there I am (passing an array as a params) through pyTigergraph.
but it gives me an error

{'data': None, 'error': TigerGraphException('Runtime Error: ["Premium", "Valuable", "Potential", "custom1", "custom2"] is not json object.', None)}

  criteria =  {
    "Premium":{
    "min_spend":300,
    "max_spend":99999999,
    "min_visit_count":30,
    "max_visit_count":50
    },
    "Valuable":{
    "min_spend":150,
    "max_spend":300,
    "min_visit_count":15,
    "max_visit_count":30
    }
    }

criteriaKey = [“Premium”, “Valuable”]

result=tiger.call_installed_query(“profile_segmentation”,{“profile_id”:int(userId), “str”: json.dumps(criteria), “segment_names”: json.dumps(criteriaKey)})

Graph studio QUERY:
CREATE QUERY profile_segmentation(Vertex profile_id, String str, Set segment_names) FOR GRAPH vehicles syntax V2{

hey @pkr2

could you try passing this set(criteriaKey) instead of json.dumps(criteriaKey)

@Mohamed_Zrouga
thanks for your response But still getting the same error

result=tiger.call_installed_query(“profile_segmentation”,{“profile_id”:int(userId), “str”: json.dumps(criteria), “segment_names”: set(criteriaKey)})

{‘data’: None, ‘error’: TigerGraphException(“Runtime Error: {‘Potential’, ‘custom1’, ‘Valuable’, ‘Premium’, ‘custom2’} is not json object.”, None)}

Thanks for your feedback sent you a message with a calendar invite link , let me know if that works for you!

@Mohamed_Zrouga yaa I saw calendar invite link

As of now I passed everything in a single string

‘segment_names=Premium&segment_names=Valuable&segment_names=Potential&segment_names=custom1&segment_names=custom2&profile_id=52&str={“Premium”: {“min_spend”: 300, “max_spend”: 99999999, “min_visit_count”: 30, “max_visit_count”: 50}, “Valuable”: {“min_spend”: 150, “max_spend”: 300, “min_visit_count”: 15, “max_visit_count”: 30}, “Potential”: {“min_spend”: 0, “max_spend”: 150, “min_visit_count”: 0, “max_visit_count”: 15}, “custom1”: {“min_spend”: 5000, “max_spend”: 10000, “min_visit_count”: 0, “max_visit_count”: 10}, “custom2”: {“min_spend”: 5000, “max_spend”: 10000, “min_visit_count”: 10, “max_visit_count”: 20}}’