rc corrected to response (#772)

* rc corrected to response

There seems to be a mistype in the code. I believe it's meant to say response

Signed-off-by: Patrick O'Connor <[email protected]>

* Corrected line 33

Signed-off-by: Patrick O'Connor <[email protected]>

---------

Signed-off-by: Patrick O'Connor <[email protected]>
This commit is contained in:
Patrick O'Connor
2024-07-11 22:30:44 -07:00
committed by GitHub
parent f0bce7cf33
commit 9ee0b23c63
+3 -3
View File
@@ -30,7 +30,7 @@ response = client.bulk(docs)
if response["errors"]: if response["errors"]:
print(f"There were errors!") print(f"There were errors!")
else: else:
print(f"Bulk-inserted {len(rc['items'])} items.") print(f"Bulk-inserted {len(response['items'])} items.")
``` ```
The client can also serialize an array of data into bulk-delimited JSON for you. See [samples/bulk/bulk_array.py](../samples/bulk/bulk_array.py) for a working sample. The client can also serialize an array of data into bulk-delimited JSON for you. See [samples/bulk/bulk_array.py](../samples/bulk/bulk_array.py) for a working sample.
@@ -51,7 +51,7 @@ if response["errors"]:
for item in response["items"]: for item in response["items"]:
print(f"{item['index']['status']}: {item['index']['error']['type']}") print(f"{item['index']['status']}: {item['index']['error']['type']}")
else: else:
print(f"Bulk-inserted {len(rc['items'])} items.") print(f"Bulk-inserted {len(response['items'])} items.")
``` ```
## Bulk Helper ## Bulk Helper
@@ -126,4 +126,4 @@ if len(failed) > 0:
if len(succeeded) > 0: if len(succeeded) > 0:
print(f"Bulk-inserted {len(succeeded)} items (streaming_bulk).") print(f"Bulk-inserted {len(succeeded)} items (streaming_bulk).")
``` ```