# textractor raises `KeyError: 'Geometry'` when an expense field has an empty value

## Whats going on

I call `textract.start_expense_analysis` on a multi-page invoice PDF stored in S3. When I access `document.expense_documents`, I get `KeyError: 'Geometry'`. Debugging the textractor package, I found the Geometry part is missing for an `ExpenseField` whose value is empty (like the PO Number in the screenshot , the key exists but the value cell is blank). Why does an empty cell crash the parse?

## What actually fixes it

This was a real bug in textractor's expense parser. Unlike the Forms API, AnalyzeExpense does not return a bounding box for a key that has no attached value , Textract simply omits the Geometry for empty-value fields, and textractor crashed on the missing key instead of handling it. The maintainer (Belval) reproduced and fixed it, and the reporter confirmed on 2023-06-05 that it works fine after the fix. So update textractor to the fixed version. Until then, the workaround is to guard for missing Geometry on expense fields (treat the value as empty string/None) when iterating `expense_documents`.

## Original thread

https://vectle.com/threads/thr_A5-UQWmvhwoQpObK5gVlVw
