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

Fixes for CI failures in dbt-labs/dbt-core #3

Merged
merged 2 commits into from
Oct 3, 2024
Merged

Fixes for CI failures in dbt-labs/dbt-core #3

merged 2 commits into from
Oct 3, 2024

Conversation

tomwphillips
Copy link
Collaborator

@tomwphillips tomwphillips commented Oct 3, 2024

https://oaknorth-bank.atlassian.net/browse/DATAPLAT-2522

See dbt-labs#10812.

Failing integration test:

 =================================== FAILURES ===================================
__________________ TestVerifyArtifactsVersions.test_versions ___________________

self = <test_artifacts.TestVerifyArtifactsVersions object at 0x7f61842f1690>
project = <dbt.tests.fixtures.project.TestProjInfo object at 0x7f6182c3d6d0>
manifest_schema_path = '/home/runner/work/dbt-core/dbt-core/schemas/dbt/manifest/v12.json'
run_results_schema_path = '/home/runner/work/dbt-core/dbt-core/schemas/dbt/run-results/v6.json'

    def test_versions(self, project, manifest_schema_path, run_results_schema_path):
        start_time = datetime.utcnow()
        results = run_dbt(["compile"])
        assert len(results) == 6
>       verify_manifest(
            project, expected_versions_manifest(project), start_time, manifest_schema_path
        )

/home/runner/work/dbt-core/dbt-core/tests/functional/artifacts/test_artifacts.py:677: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

project = <dbt.tests.fixtures.project.TestProjInfo object at 0x7f6182c3d6d0>
expected_manifest = {'child_map': {'exposure.test.notebook_exposure': [], 'model.test.ref_versioned_model': [], 'model.test.versioned_mode...'dbt_schema_version': 'https://schemas.getdbt.com/dbt/manifest/v7.json', 'dbt_version': '1.9.0b1', 'disabled': {}, ...}
start_time = datetime.datetime(2024, 10, 2, 19, 9, 26, 538088)
manifest_schema_path = '/home/runner/work/dbt-core/dbt-core/schemas/dbt/manifest/v12.json'

    def verify_manifest(project, expected_manifest, start_time, manifest_schema_path):
        manifest_path = os.path.join(project.project_root, "target", "manifest.json")
        assert os.path.exists(manifest_path)
        manifest = get_artifact(manifest_path)
        # Verify that manifest jsonschema from WritableManifest works
        manifest_schema = WritableManifest.json_schema()
        validate(manifest_schema, manifest)
    
        # Verify that stored manifest jsonschema works.
        # If this fails, schemas need to be updated with:
        #   scripts/collect-artifact-schema.py --path schemas --artifact manifest
        stored_manifest_schema = get_artifact(manifest_schema_path)
        validate(stored_manifest_schema, manifest)
    
        manifest_keys = {
            "nodes",
            "sources",
            "macros",
            "parent_map",
            "child_map",
            "group_map",
            "metrics",
            "groups",
            "docs",
            "metadata",
            "docs",
            "disabled",
            "exposures",
            "selectors",
            "semantic_models",
            "unit_tests",
            "saved_queries",
        }
    
        assert set(manifest.keys()) == manifest_keys
    
        for key in manifest_keys:
            if key == "macros":
                verify_manifest_macros(manifest, expected_manifest.get("macros"))
            elif key == "metadata":
                metadata = manifest["metadata"]
                dbt_schema_version = str(WritableManifest.dbt_schema_version)
                verify_metadata(metadata, dbt_schema_version, start_time)
                assert (
                    "project_id" in metadata
                    and metadata["project_id"] == "098f6bcd4621d373cade4e832627b4f6"
                )
                assert "project_name" in metadata and metadata["project_name"] == "test"
                assert (
                    "send_anonymous_usage_stats" in metadata
                    and metadata["send_anonymous_usage_stats"] is False
                )
                assert "adapter_type" in metadata and metadata["adapter_type"] == project.adapter_type
            elif key in ["nodes", "sources", "exposures", "metrics", "disabled", "docs"]:
                for unique_id, node in expected_manifest[key].items():
                    assert unique_id in manifest[key]
>                   assert manifest[key][unique_id] == node, f"{unique_id} did not match"
E                   AssertionError: test.test.unique_versioned_model_v1_first_name.6138195dec did not match
E                   assert {'alias': 'un... 'none'}, ...} == {'alias': 'un... 'none'}, ...}
E                     Omitting 39 identical items, use -vv to show
E                     Differing items:
E                     {'meta': {'color': 'blue', 'size': 'large'}} != {'meta': {}}
E                     Use -v to get more diff

/home/runner/work/dbt-core/dbt-core/tests/functional/artifacts/test_artifacts.py:504: AssertionError
---------------------------- Captured stdout setup -----------------------------

@tomwphillips tomwphillips merged commit b1ae003 into main Oct 3, 2024
@tomwphillips tomwphillips deleted the fixes branch October 3, 2024 11:31
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

Successfully merging this pull request may close these issues.

2 participants