diff --git a/examples/ping-extraction/update_sov.py b/examples/ping-extraction/update_sov.py index a8847bf..8db15f8 100644 --- a/examples/ping-extraction/update_sov.py +++ b/examples/ping-extraction/update_sov.py @@ -18,7 +18,7 @@ SOVID = "s-no-ping-hggcsk" LOCATIONS_CSV = "corrections.csv" -EXTRA_DATA = {"insured_name": "Acme Corp"} # policy-level fields to carry into output +EXTRA_DATA = {"insured_name": "Acme Corp"} # optional. drives the output filename OUTPUT_FORMATS = ["json"] POLL_SECONDS = 3 @@ -30,8 +30,8 @@ f"{BASE_URL}/sov/{SOVID}/initiate_update", headers=headers, ) -resp.raise_for_status() print(resp.json()) +resp.raise_for_status() UPDATE_ID = resp.json()["id"] print("initiated update job:", UPDATE_ID) @@ -43,18 +43,18 @@ files={"file": (LOCATIONS_CSV, f)}, headers=headers, ) -resp.raise_for_status() print(resp.json()) +resp.raise_for_status() -# 3. Start the job. extra_data carries policy-level fields into the output +# 3. Start the job. extra_data is optional but drives the output filename resp = requests.post( f"{BASE_URL}/sov/update/{UPDATE_ID}/start", json={"extra_data": EXTRA_DATA, "output_formats": OUTPUT_FORMATS}, headers=headers, ) -resp.raise_for_status() print(resp.json()) +resp.raise_for_status() # 4. Poll until the job reaches a terminal state