From 79739d38f1f52fa02390f84b0a4ef37a54d228f9 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 24 Jul 2024 17:43:43 -0700 Subject: [PATCH 1/2] Remove name from time spine config --- dbt_semantic_interfaces/implementations/time_spine.py | 1 - dbt_semantic_interfaces/parsing/schemas.py | 3 +-- dbt_semantic_interfaces/protocols/time_spine.py | 6 ------ tests/example_project_configuration.py | 4 +--- .../simple_semantic_manifest/project_configuration.yaml | 3 +-- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/dbt_semantic_interfaces/implementations/time_spine.py b/dbt_semantic_interfaces/implementations/time_spine.py index dcb836c0..3e5a90ff 100644 --- a/dbt_semantic_interfaces/implementations/time_spine.py +++ b/dbt_semantic_interfaces/implementations/time_spine.py @@ -30,6 +30,5 @@ class PydanticTimeSpine(HashableBaseModel, ProtocolHint[TimeSpine]): def _implements_protocol(self) -> TimeSpine: return self - name: str node_relation: PydanticNodeRelation primary_column: PydanticTimeSpinePrimaryColumn diff --git a/dbt_semantic_interfaces/parsing/schemas.py b/dbt_semantic_interfaces/parsing/schemas.py index 579b0ce0..3fe1ff2e 100644 --- a/dbt_semantic_interfaces/parsing/schemas.py +++ b/dbt_semantic_interfaces/parsing/schemas.py @@ -362,12 +362,11 @@ "$id": "time_spine_schema", "type": "object", "properties": { - "name": {"type": "string"}, "node_relation": {"$ref": "node_relation_schema"}, "primary_column": {"$ref": "time_spine_primary_column_schema"}, }, "additionalProperties": False, - "required": ["name", "node_relation", "primary_column"], + "required": ["node_relation", "primary_column"], } diff --git a/dbt_semantic_interfaces/protocols/time_spine.py b/dbt_semantic_interfaces/protocols/time_spine.py index eaf23409..c1e85c57 100644 --- a/dbt_semantic_interfaces/protocols/time_spine.py +++ b/dbt_semantic_interfaces/protocols/time_spine.py @@ -14,12 +14,6 @@ class TimeSpine(Protocol): custom granularity columns. Custom granularity columns are not yet implemented. """ - @property - @abstractmethod - def name(self) -> str: - """A name the user assigns to this time spine.""" - pass - @property @abstractmethod def node_relation(self) -> NodeRelation: diff --git a/tests/example_project_configuration.py b/tests/example_project_configuration.py index 1eb3af52..df86342b 100644 --- a/tests/example_project_configuration.py +++ b/tests/example_project_configuration.py @@ -24,7 +24,6 @@ ], time_spines=[ PydanticTimeSpine( - name="day_time_spine", node_relation=PydanticNodeRelation(alias="day_time_spine", schema_name="stuff"), primary_column=PydanticTimeSpinePrimaryColumn(name="ds_day", time_granularity=TimeGranularity.DAY), ) @@ -41,8 +40,7 @@ column_name: ds grain: day time_spines: - - name: day_time_spine - node_relation: + - node_relation: schema_name: stuff alias: day_time_spine primary_column: diff --git a/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml b/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml index 1530052f..80c6f34a 100644 --- a/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml +++ b/tests/fixtures/semantic_manifest_yamls/simple_semantic_manifest/project_configuration.yaml @@ -5,8 +5,7 @@ project_configuration: column_name: ds grain: day time_spines: - - name: day_time_spine - node_relation: + - node_relation: schema_name: stuff alias: day_time_spine primary_column: From b9247e7ca29875b8000716b4f0545f275737a9a9 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 24 Jul 2024 17:46:47 -0700 Subject: [PATCH 2/2] Update JSON schema --- .../generated_json_schemas/default_explicit_schema.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json b/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json index 9ff350b8..af402d39 100644 --- a/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json +++ b/dbt_semantic_interfaces/parsing/generated_json_schemas/default_explicit_schema.json @@ -804,9 +804,6 @@ "$id": "time_spine_schema", "additionalProperties": false, "properties": { - "name": { - "type": "string" - }, "node_relation": { "$ref": "#/definitions/node_relation_schema" }, @@ -815,7 +812,6 @@ } }, "required": [ - "name", "node_relation", "primary_column" ],