Skip to content

Commit

Permalink
fix: rename liquid_variable -> liquid_variables
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-salvi-apptware committed Jan 18, 2025
1 parent f08b827 commit f1daf12
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion metadata-ingestion/docs/sources/looker/looker_recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source:
client_secret: ${LOOKER_CLIENT_SECRET}

# Liquid variables
# liquid_variable:
# liquid_variables:
# _user_attributes:
# looker_env: "dev"
# dev_database_prefix: "employee"
Expand Down
4 changes: 2 additions & 2 deletions metadata-ingestion/docs/sources/looker/lookml_post.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#### Configuration Notes

1. If a view contains a liquid template (e.g. `sql_table_name: {{ user_attributes['db']}}.kafka_streaming.events }}`, with `db=ANALYTICS_PROD`), then you will need to specify the values of those variables in the `liquid_variable` config as shown below:
1. If a view contains a liquid template (e.g. `sql_table_name: {{ user_attributes['db']}}.kafka_streaming.events }}`, with `db=ANALYTICS_PROD`), then you will need to specify the values of those variables in the `liquid_variables` config as shown below:

```yml
liquid_variable:
liquid_variables:
user_attributes:
db: ANALYTICS_PROD
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class LiquidVariableTransformer(LookMLViewTransformer):
def _apply_transformation(self, value: str, view: dict) -> str:
return resolve_liquid_variable(
text=value,
liquid_variable=self.source_config.liquid_variable,
liquid_variable=self.source_config.liquid_variables,
report=self.reporter,
)

Expand Down Expand Up @@ -385,7 +385,7 @@ def replace_constants(match):
return str(self.source_config.lookml_constants.get(key))

# Check if it's a misplaced lookml constant
if key in self.source_config.liquid_variable:
if key in self.source_config.liquid_variables:
self.reporter.report_warning(
title="Misplaced lookml constant",
message="Misplaced lookml constant, Use 'lookml_constants' instead of 'liquid_variables'.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,17 @@ class LookMLSourceConfig(
description="When enabled, looker refinement will be processed to adapt an existing view.",
)

liquid_variable: Dict[Any, Any] = Field(
liquid_variables: Dict[Any, Any] = Field(
{},
description="A dictionary containing Liquid variables, Liquid logic, and LookML parameters with their corresponding values, utilized in SQL-defined "
"derived views. The Liquid template will be resolved in view.derived_table.sql and "
"view.sql_table_name. Defaults to an empty dictionary.",
)

_liquid_variable_deprecated = pydantic_renamed_field(
old_name="liquid_variable", new_name="liquid_variables", print_warning=True
)

lookml_constants: Dict[str, str] = Field(
{},
description=(
Expand Down

0 comments on commit f1daf12

Please sign in to comment.