Пример #1
0
def test_map_rows_to():
    ds_source = DataSource("src/tests/test_data/sample/names.csv")
    ds_target = DataSource("src/tests/test_data/sample/names.csv")
    ds_source.create_column_relation("name", "name", ds_target)
    value_matching_config = ValueMatchingConfiguration(model_type="exact")
    row_mapping_config = RowMappingConfiguration(model_type="weighted_linear",
                                                 weights={"name": 1})
    ds_source.map_rows_to(ds_target, value_matching_config, row_mapping_config)
    assert len(
        ds_source.row_relations) == 252  # Duplicate record present, hence +2
Пример #2
0
def test_describe_row_relation_for_index():
    ds_source = DataSource("src/tests/test_data/sample/names.csv")
    ds_target = DataSource("src/tests/test_data/sample/names.csv")
    ds_source.create_column_relation("name", "name", ds_target)
    description = ds_source.describe_row_relation_for_index(0)
    assert description == '{"name": "Soo Hong"}'