Skip to content

Commit

Permalink
Rename to ObjectBuilderItemDescriptionProcessor.
Browse files Browse the repository at this point in the history
  • Loading branch information
plypaul committed Aug 8, 2024
1 parent b566c14 commit 60a7306
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

if typing.TYPE_CHECKING:
from dbt_semantic_interfaces.parsing.text_input.ti_processor import (
QueryItemDescriptionProcessor,
ObjectBuilderItemDescriptionProcessor,
)

from dbt_semantic_interfaces.parsing.text_input.valid_method import ValidMethodMapping
Expand All @@ -40,7 +40,7 @@ class ObjectBuilderJinjaRenderHelper:

def __init__( # noqa: D107
self,
description_processor: QueryItemDescriptionProcessor,
description_processor: ObjectBuilderItemDescriptionProcessor,
valid_method_mapping: ValidMethodMapping,
) -> None:
self._description_processor = description_processor
Expand Down Expand Up @@ -159,7 +159,7 @@ class _RenderingClassForJinjaTemplate:

def __init__(
self,
description_processor: QueryItemDescriptionProcessor,
description_processor: ObjectBuilderItemDescriptionProcessor,
allowed_methods: FrozenSet[ObjectBuilderMethod],
initial_item_description: ObjectBuilderItemDescription,
) -> None:
Expand Down
10 changes: 5 additions & 5 deletions dbt_semantic_interfaces/parsing/text_input/ti_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ def _process_template(
self,
jinja_template: str,
valid_method_mapping: ValidMethodMapping,
description_processor: QueryItemDescriptionProcessor,
description_processor: ObjectBuilderItemDescriptionProcessor,
) -> str:
"""Helper to run a `QueryItemDescriptionProcessor` on a Jinja template."""
"""Helper to run a `ObjectBuilderItemDescriptionProcessor` on a Jinja template."""
render_helper = ObjectBuilderJinjaRenderHelper(
description_processor=description_processor,
valid_method_mapping=valid_method_mapping,
Expand All @@ -136,7 +136,7 @@ def _process_template(
return rendered


class QueryItemDescriptionProcessor(ABC):
class ObjectBuilderItemDescriptionProcessor(ABC):
"""General processor that does something to a query-item description seen in a Jinja template."""

@abstractmethod
Expand All @@ -145,7 +145,7 @@ def process_description(self, item_description: ObjectBuilderItemDescription) ->
raise NotImplementedError


class _CollectDescriptionProcessor(QueryItemDescriptionProcessor):
class _CollectDescriptionProcessor(ObjectBuilderItemDescriptionProcessor):
"""Processor that collects all descriptions that were processed."""

def __init__(self) -> None: # noqa: D107
Expand All @@ -163,7 +163,7 @@ def process_description(self, item_description: ObjectBuilderItemDescription) ->
return ""


class _RendererProcessor(QueryItemDescriptionProcessor):
class _RendererProcessor(ObjectBuilderItemDescriptionProcessor):
"""Processor that renders the descriptions in a Jinja template using the given renderer.
This is just a pass-through, but it allows `QueryItemDescriptionRenderer` to be a facade that has more appropriate
Expand Down

0 comments on commit 60a7306

Please sign in to comment.