Skip to content

Commit

Permalink
update_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenyuLInx committed Dec 12, 2024
1 parent bb5a7d0 commit 2111d71
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 32 deletions.
188 changes: 157 additions & 31 deletions schemas/dbt/manifest/v12.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dbt_version": {
"type": "string",
"default": "1.9.0b4"
"default": "1.10.0a1"
},
"generated_at": {
"type": "string"
Expand Down Expand Up @@ -4205,6 +4205,12 @@
},
"additionalProperties": false
},
"_extra": {
"type": "object",
"propertyNames": {
"type": "string"
}
},
"access": {
"enum": [
"private",
Expand Down Expand Up @@ -4779,7 +4785,7 @@
"default": null
}
},
"additionalProperties": false,
"additionalProperties": true,
"required": [
"database",
"schema",
Expand Down Expand Up @@ -7690,6 +7696,12 @@
"identifier": {
"type": "string"
},
"_extra": {
"type": "object",
"propertyNames": {
"type": "string"
}
},
"quoting": {
"type": "object",
"title": "Quoting",
Expand Down Expand Up @@ -8223,7 +8235,7 @@
"default": null
}
},
"additionalProperties": false,
"additionalProperties": true,
"required": [
"database",
"schema",
Expand Down Expand Up @@ -9121,19 +9133,7 @@
"type": "integer"
},
"granularity": {
"enum": [
"nanosecond",
"microsecond",
"millisecond",
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
]
"type": "string"
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -14014,6 +14014,12 @@
},
"additionalProperties": false
},
"_extra": {
"type": "object",
"propertyNames": {
"type": "string"
}
},
"access": {
"enum": [
"private",
Expand Down Expand Up @@ -14588,7 +14594,7 @@
"default": null
}
},
"additionalProperties": false,
"additionalProperties": true,
"required": [
"database",
"schema",
Expand Down Expand Up @@ -17490,6 +17496,12 @@
"identifier": {
"type": "string"
},
"_extra": {
"type": "object",
"propertyNames": {
"type": "string"
}
},
"quoting": {
"type": "object",
"title": "Quoting",
Expand Down Expand Up @@ -18023,7 +18035,7 @@
"default": null
}
},
"additionalProperties": false,
"additionalProperties": true,
"required": [
"database",
"schema",
Expand Down Expand Up @@ -18712,19 +18724,7 @@
"type": "integer"
},
"granularity": {
"enum": [
"nanosecond",
"microsecond",
"millisecond",
"second",
"minute",
"hour",
"day",
"week",
"month",
"quarter",
"year"
]
"type": "string"
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -20024,6 +20024,27 @@
}
],
"default": null
},
"config": {
"anyOf": [
{
"type": "object",
"title": "SemanticLayerElementConfig",
"properties": {
"meta": {
"type": "object",
"propertyNames": {
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -20178,6 +20199,27 @@
}
],
"default": null
},
"config": {
"anyOf": [
{
"type": "object",
"title": "SemanticLayerElementConfig",
"properties": {
"meta": {
"type": "object",
"propertyNames": {
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -20341,6 +20383,27 @@
}
],
"default": null
},
"config": {
"anyOf": [
{
"type": "object",
"title": "SemanticLayerElementConfig",
"properties": {
"meta": {
"type": "object",
"propertyNames": {
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -21586,6 +21649,27 @@
}
],
"default": null
},
"config": {
"anyOf": [
{
"type": "object",
"title": "SemanticLayerElementConfig",
"properties": {
"meta": {
"type": "object",
"propertyNames": {
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -21740,6 +21824,27 @@
}
],
"default": null
},
"config": {
"anyOf": [
{
"type": "object",
"title": "SemanticLayerElementConfig",
"properties": {
"meta": {
"type": "object",
"propertyNames": {
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false,
Expand Down Expand Up @@ -21903,6 +22008,27 @@
}
],
"default": null
},
"config": {
"anyOf": [
{
"type": "object",
"title": "SemanticLayerElementConfig",
"properties": {
"meta": {
"type": "object",
"propertyNames": {
"type": "string"
}
}
},
"additionalProperties": false
},
{
"type": "null"
}
],
"default": null
}
},
"additionalProperties": false,
Expand Down
8 changes: 8 additions & 0 deletions tests/functional/artifacts/expected_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ def expected_seeded_manifest(project, model_database=None, quote_model=False):
"version": None,
"latest_version": None,
"time_spine": None,
"batch": None,
},
"model.test.second_model": {
"compiled_path": os.path.join(compiled_model_path, "second_model.sql"),
Expand Down Expand Up @@ -471,6 +472,7 @@ def expected_seeded_manifest(project, model_database=None, quote_model=False):
"version": None,
"latest_version": None,
"time_spine": None,
"batch": None,
},
"seed.test.seed": {
"build_path": None,
Expand Down Expand Up @@ -958,6 +960,7 @@ def expected_references_manifest(project):
"nodes": {
"model.test.ephemeral_copy": {
"alias": "ephemeral_copy",
"batch": None,
"compiled_path": os.path.join(compiled_model_path, "ephemeral_copy.sql"),
"build_path": None,
"created_at": ANY,
Expand Down Expand Up @@ -1005,6 +1008,7 @@ def expected_references_manifest(project):
},
"model.test.ephemeral_summary": {
"alias": "ephemeral_summary",
"batch": None,
"compiled_path": os.path.join(compiled_model_path, "ephemeral_summary.sql"),
"build_path": None,
"created_at": ANY,
Expand Down Expand Up @@ -1077,6 +1081,7 @@ def expected_references_manifest(project):
},
"model.test.view_summary": {
"alias": "view_summary",
"batch": None,
"compiled_path": os.path.join(compiled_model_path, "view_summary.sql"),
"build_path": None,
"created_at": ANY,
Expand Down Expand Up @@ -1594,6 +1599,7 @@ def expected_versions_manifest(project):
"unique_id": "model.test.versioned_model.v1",
"compiled": True,
"compiled_code": ANY,
"batch": None,
"contract": {"checksum": None, "enforced": False, "alias_types": True},
"extra_ctes_injected": True,
"extra_ctes": [],
Expand All @@ -1610,6 +1616,7 @@ def expected_versions_manifest(project):
},
"model.test.versioned_model.v2": {
"alias": "versioned_model_v2",
"batch": None,
"compiled_path": os.path.join(compiled_model_path, "versioned_model_v2.sql"),
"build_path": None,
"created_at": ANY,
Expand Down Expand Up @@ -1681,6 +1688,7 @@ def expected_versions_manifest(project):
},
"model.test.ref_versioned_model": {
"alias": "ref_versioned_model",
"batch": None,
"compiled_path": os.path.join(compiled_model_path, "ref_versioned_model.sql"),
"build_path": None,
"created_at": ANY,
Expand Down
2 changes: 2 additions & 0 deletions tests/functional/artifacts/test_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ def verify_manifest(project, expected_manifest, start_time, manifest_schema_path
elif key in ["nodes", "sources", "exposures", "metrics", "disabled", "docs"]:
for unique_id, node in expected_manifest[key].items():
assert unique_id in manifest[key]
if "_event_status" in manifest[key][unique_id]:
del manifest[key][unique_id]["_event_status"]
assert manifest[key][unique_id] == node, f"{unique_id} did not match"
else: # ['docs', 'parent_map', 'child_map', 'group_map', 'selectors', 'semantic_models', 'saved_queries']
assert manifest[key] == expected_manifest[key]
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def assert_from_dict(obj, dct, cls=None):
if hasattr(obj, "created_at"):
obj_from_dict.created_at = 1
obj.created_at = 1
if "_event_status" in obj.extra:
if hasattr(obj, "extra") and "_event_status" in obj.extra:
obj.extra["_event_status"] = None
obj_from_dict.extra["_event_status"] = None
assert obj_from_dict == obj
Expand Down

0 comments on commit 2111d71

Please sign in to comment.