I have this payload:
payload = {
"cluster": "analytics",
"id_pipeline": "123456789",
"schema_compatibility": "backward",
"branch": "production"
}
And I need to remove the element "id_pipeline" and its value ("123456789").
Any suggestions? I made this code but this errors appears: "'str' object does not support item deletion"
for element in payload_data:
if 'id_pipeline' in element:
del element['id_pipeline']
The desirable output payload is something like this:
payload = {
"cluster": "analytics",
"schema_compatibility": "backward",
"branch": "production"
}
Obs: I need to keep json format.