Skip to content

Fix extract.ai implicit input excluding output columns - #1108

Open
mborodii-prog wants to merge 1 commit into
mainfrom
1076-bug-extractai-acts-up-when-columns-already-exist
Open

Fix extract.ai implicit input excluding output columns#1108
mborodii-prog wants to merge 1 commit into
mainfrom
1076-bug-extractai-acts-up-when-columns-already-exist

Conversation

@mborodii-prog

Copy link
Copy Markdown
Contributor

Summary

Fixes extract.ai recipe behavior when an output column already exists in the input dataframe.

Previously, if extract.ai was run without an explicit input, the entire dataframe was sent to the AI model, including columns that the wrangle was about to overwrite. This meant an existing output column value could influence the extraction result.

For example, an existing length = 123 column could cause some rows to keep 123 instead of extracting values like 25mm or 3mm from the source text.

Changes

  • Updated extract.ai recipe handling so implicit input excludes target output columns.
  • Preserved explicit input: behavior exactly as requested by the recipe.
  • Added a mocked regression test covering an existing output column.
  • Confirmed existing mocked output-format behavior still passes.

Behavior

Given:

wrangles:
- create.column:
    output: length
    value: 123

- extract.ai:
    model: gpt-4o-mini
    api_key: ${OPENAI_API_KEY}
    output:
      length:
        type: string
        description: Any lengths found in the data

extract.ai now sends only the source input columns to the model by default, not the pre-existing length output column.

Expected output:

data              length
wrench 25mm       25mm
6m cable          6m
screwdriver 3mm   3mm

@mborodii-prog
mborodii-prog requested a review from thomasstvr July 31, 2026 12:12
@mborodii-prog mborodii-prog linked an issue Jul 31, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] extract.ai acts up when columns already exist

1 participant