I m trying to beatuify dicitonary using json.dumps , but as soon as it beautify , the data type changes from dictionary to string. Chnage of datatype to string not allowing it to post on slack channel.
Error while posting it on slack - Str indices must be integer. Point is either I ensure while beatufying data type dont changes or modificaiton be to done at slack configuraton end.
Error while posting it on slack - Str indices must be integer. Point is either I ensure while beatufying data type dont changes or modificaiton be to done at slack configuraton end.
input = {"checkType":"employeePurchase_not_true","output":[{"purchaseType":"ORDER","recordCount":["AU: 1","FR: 1","IT: 11","BE: 1","AT: 1","SE: 1","ES: 1","FI: 1","NL: 1","PT: 1","NO: 1","DE: 2","PL: 1","SI: 1","IE: 1","GB: 7","DK: 1","US: 1","SK: 1","RU: 2","CA: 1","CH: 1"]},{"purchaseType":"RECEIPT","recordCount":["AU: 956","FR: 1","IT: 5","BE: 165","AT: 2","SE: 1","ES: 5765","FI: 1","NL: 2","CZ: 308","HU: 1","KR: 2","NO: 3","IN: 3","DE: 45","PL: 1","SI: 1","JP: 3","GB: 2","RS: 1","DK: 5","US: 762","RU: 442","RO: 1","HR: 13","CA: 3","CH: 36"]}]} slack_msg["channel"] = "ce-ecd-ops-dataquality" slack_msg["message"] = input d=json.dumps(slack_msg,indent=4) send_slack_alert(d)
buran write Apr-11-2021, 06:43 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.