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

Foreign Key Validation Errors Not Displaying After Transformations #1724

Open
megin1989 opened this issue Jan 1, 2025 · 0 comments
Open

Comments

@megin1989
Copy link

Problem:

While using Frictionless to validate data, foreign key-related errors are not being displayed when the cell_convert transformation is applied to specific fields. While other foreign key validation errors are correctly shown, one particular foreign key error is not displayed, even though the reference between resources is incorrect.

Steps to Reproduce:

  1. Use the following common_transform_steps for transforming field values to lowercase:

    common_transform_steps = [ 
        ("ORGANIZATION_TYPE_DISPLAY", "organization_type_display"), 
        ("FACILITY_STATE", "facility_state"),    
    ]
  2. Apply the transformation in the following loop:

    for resource in package.resources:
        transform_steps = [
            steps.cell_convert(field_name=field_name, function=lambda value: value.lower())
            for field_name, _ in common_transform_steps
            if any(field.name == field_name for field in resource.schema.fields)
        ]
        resource = transform(resource, steps=transform_steps)
  3. Validate the package using Frictionless:

    report = package.validate()
  4. Expected Outcome: All foreign key errors, including those related to missing or invalid references, should be displayed.

  5. Actual Outcome: While other foreign key errors are shown, one specific foreign key error (related to the reference between certain fields) does not appear in the validation report, despite the incorrect reference.

Additional Information:

  • The fields being transformed (cell_convert) are not foreign key fields.
  • The foreign key fields are correctly referenced between resources (i.e., primary key and foreign key relations are set up).
  • The issue occurs even after transforming data fields that are not foreign keys.
  • The specific foreign key error that is not showing is related to the relationship_person_code field, where the value in the reference column does not exist in the related resource.

What I Have Tried:

  • Validated the package before and after applying the transformations, but foreign key errors are not showing up for the relationship_person_code field.
  • Ensured that foreign key relationships are correctly defined in the schema.

Request:

I would like to understand if there's a way to ensure that all validation errors, including foreign key violations, are displayed after applying transformations, and if there's a setting to suppress or handle case-sensitivity in the foreign key validation process.

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