Skip to content

Commit

Permalink
Add is_list jinja filter
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Oct 1, 2024
1 parent 98ccfce commit 8221314
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dbt_common/clients/jinja.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,11 +470,16 @@ def __reduce__(self) -> NoReturn:
return Undefined


def is_list(value):
return isinstance(value, list)


NATIVE_FILTERS: Dict[str, Callable[[Any], Any]] = {
"as_text": TextMarker,
"as_bool": BoolMarker,
"as_native": NativeMarker,
"as_number": NumberMarker,
"is_list": is_list,
}


Expand All @@ -483,6 +488,7 @@ def __reduce__(self) -> NoReturn:
"as_bool": lambda x: x,
"as_native": lambda x: x,
"as_number": lambda x: x,
"is_list": is_list,
}


Expand Down

0 comments on commit 8221314

Please sign in to comment.