Skip to content

khiops.core.helpers.build_multi_table_dictionary_domain does not behave as expected #386

@tramora

Description

@tramora

Description

When using khiops.core.helpers.build_multi_table_dictionary_domain a user @MathieuCoupe does not get what he expects
(the root table appears twice in the dictionary and the additional table is missing)

Questions/Ideas

The user rewrote a quick version of the function that would fullfil his need

def build_multi_table_dictionary(root: Dictionary, secondary: Dictionary) -> DictionaryDomain:
    # Build and initialize root target dictionary from the input dictionary domain
    root_target_dictionary = Dictionary()
    root_target_dictionary.name = root.name
    root_target_dictionary.key = root.key
    root_target_dictionary.root = True

    # Copy the variables from source dictionary to target dictionary
    for source_variable in root.variables:
        root_target_dictionary.add_variable(source_variable)

    # Build target variable for the target root dictionary
    target_variable = Variable()
    target_variable.name = secondary.name
    target_variable.type = "Table"
    target_variable.object_type = secondary.name
    root_target_dictionary.add_variable(target_variable)

    # copy the secondary dictionary
    secondary_target_dictionary = secondary.copy()

    # Build target domain and add dictionaries to it
    result = DictionaryDomain()
    result.add_dictionary(root_target_dictionary)
    result.add_dictionary(secondary_target_dictionary)

    return result

Metadata

Metadata

Assignees

Labels

Priority/0-HighTo do nowSize/HoursVery shortStatus/DoneThe issue has been addressed and merged to the dev branch

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions