From 79916e800575958a3e1cfb3a2053afdbd6eee954 Mon Sep 17 00:00:00 2001 From: Devon Fulcher <24593113+DevonFulcher@users.noreply.github.com> Date: Thu, 24 Oct 2024 14:35:36 -0500 Subject: [PATCH] Fix naming --- .../implementations/element_config.py | 6 +++--- .../implementations/elements/dimension.py | 4 ++-- .../implementations/elements/entity.py | 4 ++-- .../implementations/elements/measure.py | 4 ++-- dbt_semantic_interfaces/protocols/dimension.py | 4 ++-- dbt_semantic_interfaces/protocols/entity.py | 4 ++-- dbt_semantic_interfaces/protocols/measure.py | 4 ++-- dbt_semantic_interfaces/protocols/meta.py | 2 +- tests/test_implements_satisfy_protocols.py | 10 +++++----- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/dbt_semantic_interfaces/implementations/element_config.py b/dbt_semantic_interfaces/implementations/element_config.py index 0da5e278..d8ec41dd 100644 --- a/dbt_semantic_interfaces/implementations/element_config.py +++ b/dbt_semantic_interfaces/implementations/element_config.py @@ -4,15 +4,15 @@ from typing_extensions import override from dbt_semantic_interfaces.implementations.base import HashableBaseModel -from dbt_semantic_interfaces.protocols.meta import PydanticSemanticLayerElementConfig +from dbt_semantic_interfaces.protocols.meta import SemanticLayerElementConfig from dbt_semantic_interfaces.protocols.protocol_hint import ProtocolHint -class SemanticLayerElementConfig(HashableBaseModel, ProtocolHint[PydanticSemanticLayerElementConfig]): +class PydanticSemanticLayerElementConfig(HashableBaseModel, ProtocolHint[SemanticLayerElementConfig]): """PydanticDimension config.""" @override - def _implements_protocol(self) -> PydanticSemanticLayerElementConfig: # noqa: D + def _implements_protocol(self) -> SemanticLayerElementConfig: # noqa: D return self meta: Dict[str, Any] = Field(default_factory=dict) diff --git a/dbt_semantic_interfaces/implementations/elements/dimension.py b/dbt_semantic_interfaces/implementations/elements/dimension.py index ddbcdca9..a4cb5a03 100644 --- a/dbt_semantic_interfaces/implementations/elements/dimension.py +++ b/dbt_semantic_interfaces/implementations/elements/dimension.py @@ -7,7 +7,7 @@ ModelWithMetadataParsing, ) from dbt_semantic_interfaces.implementations.element_config import ( - SemanticLayerElementConfig, + PydanticSemanticLayerElementConfig, ) from dbt_semantic_interfaces.implementations.metadata import PydanticMetadata from dbt_semantic_interfaces.references import ( @@ -51,7 +51,7 @@ class PydanticDimension(HashableBaseModel, ModelWithMetadataParsing): expr: Optional[str] = None metadata: Optional[PydanticMetadata] label: Optional[str] = None - config: Optional[SemanticLayerElementConfig] + config: Optional[PydanticSemanticLayerElementConfig] @property def reference(self) -> DimensionReference: # noqa: D diff --git a/dbt_semantic_interfaces/implementations/elements/entity.py b/dbt_semantic_interfaces/implementations/elements/entity.py index 2496eaea..9a6557e8 100644 --- a/dbt_semantic_interfaces/implementations/elements/entity.py +++ b/dbt_semantic_interfaces/implementations/elements/entity.py @@ -7,7 +7,7 @@ ModelWithMetadataParsing, ) from dbt_semantic_interfaces.implementations.element_config import ( - SemanticLayerElementConfig, + PydanticSemanticLayerElementConfig, ) from dbt_semantic_interfaces.implementations.metadata import PydanticMetadata from dbt_semantic_interfaces.references import EntityReference @@ -24,7 +24,7 @@ class PydanticEntity(HashableBaseModel, ModelWithMetadataParsing): expr: Optional[str] = None metadata: Optional[PydanticMetadata] = None label: Optional[str] = None - config: Optional[SemanticLayerElementConfig] + config: Optional[PydanticSemanticLayerElementConfig] @property def reference(self) -> EntityReference: # noqa: D diff --git a/dbt_semantic_interfaces/implementations/elements/measure.py b/dbt_semantic_interfaces/implementations/elements/measure.py index 08b39db0..f3c88c00 100644 --- a/dbt_semantic_interfaces/implementations/elements/measure.py +++ b/dbt_semantic_interfaces/implementations/elements/measure.py @@ -7,7 +7,7 @@ ModelWithMetadataParsing, ) from dbt_semantic_interfaces.implementations.element_config import ( - SemanticLayerElementConfig, + PydanticSemanticLayerElementConfig, ) from dbt_semantic_interfaces.implementations.metadata import PydanticMetadata from dbt_semantic_interfaces.references import MeasureReference @@ -49,7 +49,7 @@ class PydanticMeasure(HashableBaseModel, ModelWithMetadataParsing): non_additive_dimension: Optional[PydanticNonAdditiveDimensionParameters] = None agg_time_dimension: Optional[str] = None label: Optional[str] = None - config: Optional[SemanticLayerElementConfig] = None + config: Optional[PydanticSemanticLayerElementConfig] = None @property def reference(self) -> MeasureReference: # noqa: D diff --git a/dbt_semantic_interfaces/protocols/dimension.py b/dbt_semantic_interfaces/protocols/dimension.py index bcebac4e..f0ac3b67 100644 --- a/dbt_semantic_interfaces/protocols/dimension.py +++ b/dbt_semantic_interfaces/protocols/dimension.py @@ -3,7 +3,7 @@ from abc import abstractmethod from typing import Optional, Protocol -from dbt_semantic_interfaces.protocols.meta import PydanticSemanticLayerElementConfig +from dbt_semantic_interfaces.protocols.meta import SemanticLayerElementConfig from dbt_semantic_interfaces.protocols.metadata import Metadata from dbt_semantic_interfaces.references import ( DimensionReference, @@ -111,5 +111,5 @@ def label(self) -> Optional[str]: @property @abstractmethod - def config(self) -> Optional[PydanticSemanticLayerElementConfig]: # noqa: D + def config(self) -> Optional[SemanticLayerElementConfig]: # noqa: D pass diff --git a/dbt_semantic_interfaces/protocols/entity.py b/dbt_semantic_interfaces/protocols/entity.py index ff0b1703..27719d1a 100644 --- a/dbt_semantic_interfaces/protocols/entity.py +++ b/dbt_semantic_interfaces/protocols/entity.py @@ -3,7 +3,7 @@ from abc import abstractmethod from typing import Optional, Protocol -from dbt_semantic_interfaces.protocols.meta import PydanticSemanticLayerElementConfig +from dbt_semantic_interfaces.protocols.meta import SemanticLayerElementConfig from dbt_semantic_interfaces.references import EntityReference from dbt_semantic_interfaces.type_enums import EntityType @@ -64,5 +64,5 @@ def label(self) -> Optional[str]: @property @abstractmethod - def config(self) -> Optional[PydanticSemanticLayerElementConfig]: # noqa: D + def config(self) -> Optional[SemanticLayerElementConfig]: # noqa: D pass diff --git a/dbt_semantic_interfaces/protocols/measure.py b/dbt_semantic_interfaces/protocols/measure.py index 7f4dead5..7d8606f8 100644 --- a/dbt_semantic_interfaces/protocols/measure.py +++ b/dbt_semantic_interfaces/protocols/measure.py @@ -3,7 +3,7 @@ from abc import abstractmethod from typing import Optional, Protocol, Sequence -from dbt_semantic_interfaces.protocols.meta import PydanticSemanticLayerElementConfig +from dbt_semantic_interfaces.protocols.meta import SemanticLayerElementConfig from dbt_semantic_interfaces.references import MeasureReference from dbt_semantic_interfaces.type_enums import AggregationType @@ -102,5 +102,5 @@ def label(self) -> Optional[str]: @property @abstractmethod - def config(self) -> Optional[PydanticSemanticLayerElementConfig]: # noqa: D + def config(self) -> Optional[SemanticLayerElementConfig]: # noqa: D pass diff --git a/dbt_semantic_interfaces/protocols/meta.py b/dbt_semantic_interfaces/protocols/meta.py index ec4b06e1..08a1eef8 100644 --- a/dbt_semantic_interfaces/protocols/meta.py +++ b/dbt_semantic_interfaces/protocols/meta.py @@ -2,7 +2,7 @@ from typing import Any, Dict, Protocol -class PydanticSemanticLayerElementConfig(Protocol): # noqa: D +class SemanticLayerElementConfig(Protocol): # noqa: D """The config property allows you to configure additional resources/metadata.""" @property diff --git a/tests/test_implements_satisfy_protocols.py b/tests/test_implements_satisfy_protocols.py index 1288982b..0c4ec8e7 100644 --- a/tests/test_implements_satisfy_protocols.py +++ b/tests/test_implements_satisfy_protocols.py @@ -4,7 +4,7 @@ from hypothesis.strategies import booleans, builds, from_type, just, lists, none, text from dbt_semantic_interfaces.implementations.element_config import ( - SemanticLayerElementConfig, + PydanticSemanticLayerElementConfig, ) from dbt_semantic_interfaces.implementations.elements.dimension import ( PydanticDimension, @@ -69,7 +69,7 @@ expr=OPTIONAL_STR_STRATEGY, metadata=OPTIONAL_METADATA_STRATEGY, label=OPTIONAL_STR_STRATEGY, - config=builds(SemanticLayerElementConfig), + config=builds(PydanticSemanticLayerElementConfig), ) DIMENSION_VALIDITY_PARAMS_STRATEGY = builds( @@ -86,7 +86,7 @@ expr=OPTIONAL_STR_STRATEGY, metadata=OPTIONAL_METADATA_STRATEGY, label=OPTIONAL_STR_STRATEGY, - config=builds(SemanticLayerElementConfig), + config=builds(PydanticSemanticLayerElementConfig), ) DIMENSION_STRATEGY = TIME_DIMENSION_STRATEGY | CATEGORICAL_DIMENSION_STRATEGY @@ -98,7 +98,7 @@ expr=OPTIONAL_STR_STRATEGY, metadata=OPTIONAL_METADATA_STRATEGY, label=OPTIONAL_STR_STRATEGY, - config=builds(SemanticLayerElementConfig), + config=builds(PydanticSemanticLayerElementConfig), ) MEASURE_STRATEGY = builds( @@ -110,7 +110,7 @@ non_additive_dimesnion=builds(PydanticNonAdditiveDimensionParameters) | none(), agg_time_dimension=OPTIONAL_STR_STRATEGY, label=OPTIONAL_STR_STRATEGY, - config=builds(SemanticLayerElementConfig), + config=builds(PydanticSemanticLayerElementConfig), ) SEMANTIC_MODEL_STRATEGY = builds(