Skip to content

Commit 5b9b411

Browse files
tpellissierclaude
andcommitted
Remove UpsertMultiple debug wrapper from example
UpsertMultiple now works correctly after the payload fix. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent cfc2056 commit 5b9b411

1 file changed

Lines changed: 14 additions & 22 deletions

File tree

examples/advanced/alternate_keys_upsert.py

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -159,28 +159,20 @@ def main():
159159
print(" Upserted EXT-002 (single)")
160160

161161
print("\n4c. Upsert multiple records (UpsertMultiple bulk)...")
162-
try:
163-
client.records.upsert(
164-
TABLE_NAME,
165-
[
166-
UpsertItem(
167-
alternate_key={KEY_COLUMN.lower(): "EXT-003"},
168-
record={"new_productname": "Widget C", "new_price": 29.99},
169-
),
170-
UpsertItem(
171-
alternate_key={KEY_COLUMN.lower(): "EXT-004"},
172-
record={"new_productname": "Widget D", "new_price": 39.99},
173-
),
174-
],
175-
)
176-
print(" Upserted EXT-003, EXT-004 (bulk)")
177-
except Exception as ex: # noqa: BLE001
178-
print(f" UpsertMultiple FAILED: {ex}")
179-
if hasattr(ex, "status_code"):
180-
print(f" Status: {ex.status_code}")
181-
if hasattr(ex, "service_error_code"):
182-
print(f" Service error code: {ex.service_error_code}")
183-
print(" (single upsert worked, bulk did not - known issue under investigation)")
162+
client.records.upsert(
163+
TABLE_NAME,
164+
[
165+
UpsertItem(
166+
alternate_key={KEY_COLUMN.lower(): "EXT-003"},
167+
record={"new_productname": "Widget C", "new_price": 29.99},
168+
),
169+
UpsertItem(
170+
alternate_key={KEY_COLUMN.lower(): "EXT-004"},
171+
record={"new_productname": "Widget D", "new_price": 39.99},
172+
),
173+
],
174+
)
175+
print(" Upserted EXT-003, EXT-004 (bulk)")
184176

185177
# ------------------------------------------------------------------
186178
# Step 5: Upsert again (updates existing via single PATCH)

0 commit comments

Comments
 (0)