Esempio n. 1
0
def test_documentation():
    platform = "urn:li:dataPlatform:kafka"
    dataset_name = ("test-timeline-sample-kafka")
    env = "PROD"
    dataset_urn = f"urn:li:dataset:({platform},{dataset_name},{env})"

    put(dataset_urn, "institutionalMemory",
        "test_resources/timeline/newdocumentation.json")
    put(dataset_urn, "institutionalMemory",
        "test_resources/timeline/newdocumentationv2.json")
    put(dataset_urn, "institutionalMemory",
        "test_resources/timeline/newdocumentationv3.json")

    res_data = timeline_cli.get_timeline(dataset_urn, ["DOCUMENTATION"], None,
                                         None, False)

    delete_cli.delete_one_urn_cmd(dataset_urn, False, False, "dataset", None,
                                  None)
    assert res_data
    assert len(res_data) == 3
    assert res_data[0]["semVerChange"] == "MINOR"
    assert len(res_data[0]["changeEvents"]) == 1
    assert res_data[1]["semVerChange"] == "MINOR"
    assert len(res_data[1]["changeEvents"]) == 1
    assert res_data[2]["semVerChange"] == "MINOR"
    assert len(res_data[2]["changeEvents"]) == 3
    assert res_data[2]["semVer"] == "0.2.0-computed"
Esempio n. 2
0
def test_glossary():
    platform = "urn:li:dataPlatform:kafka"
    dataset_name = ("test-timeline-sample-kafka")
    env = "PROD"
    dataset_urn = f"urn:li:dataset:({platform},{dataset_name},{env})"

    put(dataset_urn, "glossaryTerms",
        "test_resources/timeline/newglossary.json")
    put(dataset_urn, "glossaryTerms",
        "test_resources/timeline/newglossaryv2.json")
    put(dataset_urn, "glossaryTerms",
        "test_resources/timeline/newglossaryv3.json")

    res_data = timeline_cli.get_timeline(dataset_urn, ["GLOSSARY_TERM"], None,
                                         None, False)

    delete_cli.delete_one_urn_cmd(dataset_urn, False, False, "dataset", None,
                                  None)
    assert res_data
    assert len(res_data) == 3
    assert res_data[0]["semVerChange"] == "MINOR"
    assert len(res_data[0]["changeEvents"]) == 1
    assert res_data[1]["semVerChange"] == "MINOR"
    assert len(res_data[1]["changeEvents"]) == 1
    assert res_data[2]["semVerChange"] == "MINOR"
    assert len(res_data[2]["changeEvents"]) == 2
    assert res_data[2]["semVer"] == "0.2.0-computed"
Esempio n. 3
0
def test_all():
    platform = "urn:li:dataPlatform:kafka"
    dataset_name = ("test-timeline-sample-kafka")
    env = "PROD"
    dataset_urn = f"urn:li:dataset:({platform},{dataset_name},{env})"

    ingest_file_via_rest("tests/timeline/timeline_test_data.json")
    ingest_file_via_rest("tests/timeline/timeline_test_datav2.json")
    ingest_file_via_rest("tests/timeline/timeline_test_datav3.json")

    res_data = timeline_cli.get_timeline(dataset_urn, [
        "TAG", "DOCUMENTATION", "TECHNICAL_SCHEMA", "GLOSSARY_TERM",
        "OWNERSHIP"
    ], None, None, False)

    delete_cli.delete_one_urn_cmd(dataset_urn, False, False, "dataset", None,
                                  None)
    assert res_data
    assert len(res_data) == 3
    assert res_data[0]["semVerChange"] == "MINOR"
    assert len(res_data[0]["changeEvents"]) == 10
    assert res_data[1]["semVerChange"] == "MAJOR"
    assert len(res_data[1]["changeEvents"]) == 9
    assert res_data[2]["semVerChange"] == "MAJOR"
    assert len(res_data[2]["changeEvents"]) == 7
    assert res_data[2]["semVer"] == "2.0.0-computed"
Esempio n. 4
0
def test_schema():
    platform = "urn:li:dataPlatform:kafka"
    dataset_name = ("test-timeline-sample-kafka")
    env = "PROD"
    dataset_urn = f"urn:li:dataset:({platform},{dataset_name},{env})"

    put(dataset_urn, "schemaMetadata",
        "test_resources/timeline/newschema.json")
    put(dataset_urn, "schemaMetadata",
        "test_resources/timeline/newschemav2.json")
    put(dataset_urn, "schemaMetadata",
        "test_resources/timeline/newschemav3.json")

    res_data = timeline_cli.get_timeline(dataset_urn, ["TECHNICAL_SCHEMA"],
                                         None, None, False)

    delete_cli.delete_one_urn_cmd(dataset_urn, False, False, "dataset", None,
                                  None)
    assert res_data
    assert len(res_data) == 3
    assert res_data[0]["semVerChange"] == "MINOR"
    assert len(res_data[0]["changeEvents"]) == 6
    assert res_data[1]["semVerChange"] == "MAJOR"
    assert len(res_data[1]["changeEvents"]) == 2
    assert res_data[2]["semVerChange"] == "MAJOR"
    assert len(res_data[2]["changeEvents"]) == 2
    assert res_data[2]["semVer"] == "2.0.0-computed"