Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composite primary key accepts missing values in key fields #1623

Open
fjuniorr opened this issue Jan 22, 2024 · 0 comments
Open

Composite primary key accepts missing values in key fields #1623

fjuniorr opened this issue Jan 22, 2024 · 0 comments

Comments

@fjuniorr
Copy link
Contributor

Here's a reprex:

from frictionless import validate

descriptor = {
    'resources': [
        {
            'name': 'name',
            'data':  [
                ['id1', 'id2'],
                ['a', '1'],
                ['a', None],
            ],
            'schema': {
                'fields': [
                    {'name': 'id1'},
                    {'name': 'id2'},
                ],
                'primaryKey': ['id1', 'id2']
            }
        }
    ],
}
report = validate(descriptor)

From my understanding1 report.valid should be False because primary key columns cannot have null values but it returns True in frictionless==5.16.0.

Footnotes

  1. The pattern Table Schema: Unique constraints that came from https://github.com/frictionlessdata/specs/issues/593 supports the case in which we need to prevent duplicates and store NULL values.

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

No branches or pull requests

1 participant