From ef24c5782977a337e574e3a326ea5856b48ed98d Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 24 Jul 2024 18:09:52 -0700 Subject: [PATCH] Remove name from time spine config (#317) ### Description Remove `name` field from `TimeSpine` objects. The designs have changed so that there is no longer a name separate from the time spine's model. The model alias will be used instead, which makes this field redundant. This won't be a breaking change for manifests because none of them have this object yet. (Only an empty list in the `time_spines` field.) ### Checklist - [x] I have read [the contributing guide](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md) and understand what's expected of me - [x] I have signed the [CLA](https://docs.getdbt.com/docs/contributor-license-agreements) - [x] This PR includes tests, or tests are not required/relevant for this PR - [ ] I have run `changie new` to [create a changelog entry](https://github.com/dbt-labs/dbt-semantic-interfaces/blob/main/CONTRIBUTING.md#adding-a-changelog-entry) --- dbt_semantic_interfaces/implementations/time_spine.py | 1 - .../generated_json_schemas/default_explicit_schema.json | 4 ---- 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 +-- 6 files changed, 3 insertions(+), 18 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/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" ], 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: