Skip to content

Airtable source assumes primary field is primary key #660

Description

@waterworthd-cim

dlt version

1.17.1

Source name

airtable

Describe the problem

The airtable source assumes the airtable primary field is functionally equivalent to a primary key. However it isn't, it can be null and include duplicates (it's actually the first field of the table, and users can change field order). The actual "primary key" should probably be the hidden "id" field which is a uuid and is not null and unique.

primary_key_id = table["primaryFieldId"]

Expected behavior

Can replicate airtables that have a primary field that contains nulls or duplicates

Steps to reproduce

Create an airtable base with a table where the primary (first field) contains blanks or duplicates and try and replicate to duckdb or others, an exception is thrown because dlt sets the primary_key property in the airtable_resource function to the (non-unique) primary field rather than the id field of the airtable.

How you are using the source?

I run this source in production.

Operating system

Linux, macOS

Runtime environment

Local

Python version

3.10

dlt destination

duckdb

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Planned

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions