aws-samples / aws-samples/amazon-textract-response-parser
`merge_table` does not handle merge child table header columns properly
- Dominant language
- TypeScript
- Stars
- 236
- Forks
- 97
- PR merge metrics
- No merged PRs in 30d
Description
# Issue
The expectation from using `merge_tables` is that it will convert 2 tables like this:
```
Headers:
C1 C2 C3
Rows:
R1
R2
Headers:
R3
Rows:
R4
```
into:
```
Headers:
C1 C2 C3
Rows:
R1
R2
R3
R4
```
But instead the output is
```
Headers:
C1 C2 C3
R3
Rows:
R1
R2
R4
```
This is because the headers are identified based on the existence of `COLUMN_HEADER` in a block's `EntityTypes` field and the child table's top block keep this entity type even after merging. The solution is to simply drop the this value from `EntityTypes` if it's there while merging.
Contributor guide
Research direction
Start at the TypeScript implementation of merge_table/merge_tables and reproduce the two-table example from the issue. Inspect how COLUMN_HEADER in EntityTypes is handled while merging; done means the child table header is treated as a row and the merged output contains C1 C2 C3 followed by R1 through R4.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, typescript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100