File tree Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Expand file tree Collapse file tree 3 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 11[project ]
22name = " cube_dbt"
3- version = " 0.5.4 "
3+ version = " 0.6.0 "
44description = " dbt integration for Cube"
55authors = [
66 {name = " Artyom Keydunov" , email = " artyom@cube.dev" },
Original file line number Diff line number Diff line change 11import yaml
22
3+ class SafeString (str ):
4+ is_safe : bool
5+
6+ def __init__ (self , v : str ):
7+ self .is_safe = True
8+
39class Dumper (yaml .Dumper ):
410 def increase_indent (self , flow = False , indentless = False ):
511 return super (Dumper , self ).increase_indent (flow , indentless )
6-
12+
713def indent_string (string : str , indent : int ) -> str :
814 return '\n ' .join (
915 (' ' * indent if i > 0 else '' ) +
@@ -19,4 +25,4 @@ def dump(data, indent: int=0) -> str:
1925 allow_unicode = True ,
2026 indent = 0
2127 )
22- return indent_string (dump , indent )
28+ return SafeString ( indent_string (dump , indent ) )
Original file line number Diff line number Diff line change 11from cube_dbt .column import Column
2- from cube_dbt .dump import dump
2+ from cube_dbt .dump import dump , SafeString
33
44class Model :
55 def __init__ (self , model_dict : dict ) -> None :
@@ -90,4 +90,4 @@ def as_dimensions(self, skip: list[str]=[]) -> str:
9090 {{ dbt.model('name').as_dimensions(skip=['id']) }}
9191 """
9292 dimensions = self ._as_dimensions (skip )
93- return dump (dimensions , indent = 6 ) if dimensions else ''
93+ return dump (dimensions , indent = 6 ) if dimensions else SafeString ( '' )
You can’t perform that action at this time.
0 commit comments