Skip to content

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

Description

@thomasstvr

When an output column of extract.ai already exists, it affects the output of the extract. For example, by running the test below:

df = wrangles.recipe.run(
    """
    wrangles:
    - create.column:
        output: length
        value: 123
        
    - extract.ai:
        model: gpt-4o-mini
        api_key: ${OPENAI_API_KEY}
        seed: 1
        timeout: 60
        retries: 2
        output:
            length:
            type: string
            description: >-
                Any lengths found in the data
                such as cm, m, ft, etc.
    """,
    dataframe=pd.DataFrame({
        "data": [
            "wrench 25mm",
            "6m cable",
            "screwdriver 3mm"
        ],
    })
)

The output becomes:

Index data length
0 wrench 25mm 123
1 6m cable 6m
2 screwdriver 3mm 123

Instead of the expected:

Index data length
0 wrench 25mm 25mm
1 6m cable 6m
2 screwdriver 3mm 3mm

Metadata

Metadata

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions