Skip to content

Metadata visualization shows table key not relationship key for relationships #2839

@frances-h

Description

@frances-h

Environment Details

Please indicate the following details about the environment in which you found the bug:

  • SDV version:
  • Python version:
  • Operating System:

Error Description

Currently, Metadata visualization always shows the parent table primary key in the relationship, even if the 'parent_primary_key' value in the relationship is a different column. The metadata visualization should show the values set by the relationship to help with visual debugging when validation fails.

Steps to reproduce

metadata = Metadata.load_from_dict({
    'tables': {
        'parent': {
            'columns': {
                'pk': {'sdtype': 'id'},
                'other': {'sdtype': 'categorical'},
            },
            'primary_key': 'pk',
        },
        'child': {
            'columns': {
                'fk': {'sdtype': 'id'},
            },
        },
    },
    'relationships': [{
        'parent_table_name': 'parent',
        'child_table_name': 'child',
        'parent_primary_key': 'other',
        'child_foreign_key': 'fk',
    }]
})
metadata.visualize()
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions