|
1 | 1 | /* |
2 | | - * Copyright (c) Business Thinking Ltd. 2019-2023 |
| 2 | + * Copyright (c) Business Thinking Ltd. 2019-2024 |
3 | 3 | * This software includes code developed by the AutomateDV (f.k.a dbtvault) Team at Business Thinking Ltd. Trading as Datavault |
4 | 4 | */ |
5 | 5 |
|
6 | 6 |
|
7 | | -{% macro wrap_warning(warning_message) %} |
8 | | - |
9 | | - {%- set new_message = [] -%} |
10 | | - {%- set length_list = [] -%} |
11 | | - |
12 | | - {%- for ln in warning_message.split('\n') -%} |
13 | | - {%- do new_message.append((ln | trim)) -%} |
14 | | - {%- do length_list.append((ln | length)) -%} |
15 | | - {%- endfor -%} |
16 | | - |
17 | | - {%- set max_line_length = length_list | max -%} |
18 | | - {%- set padding_length = (max_line_length - 7) // 2 -%} |
19 | | - |
20 | | - {%- set border = modules.itertools.repeat('=', padding_length) | join ('') ~ 'WARNING' ~ modules.itertools.repeat('=', padding_length) | join ('') -%} |
21 | | - |
22 | | - {%- set wrapped_message = '\n' ~ border ~ '\n' ~ new_message | join('\n') ~ '\n' ~ border -%} |
23 | | - |
24 | | - {%- do return(wrapped_message) -%} |
25 | | - |
26 | | -{% endmacro %} |
27 | | - |
28 | | - |
29 | 7 | {%- macro datepart_too_small_error(period) -%} |
30 | 8 |
|
31 | 9 | {%- set message -%} |
|
35 | 13 | Please see: https://automate-dv.readthedocs.io/en/latest/materialisations/ |
36 | 14 | {%- endset -%} |
37 | 15 |
|
38 | | - {%- if execute -%} |
39 | | - {{- exceptions.raise_compiler_error(message) -}} |
40 | | - {%- endif -%} |
41 | | - |
| 16 | + {%- do automate_dv.log_error(message) -%} |
42 | 17 | {%- endmacro -%} |
43 | 18 |
|
44 | 19 |
|
|
51 | 26 | Please see: https://automate-dv.readthedocs.io/en/latest/materialisations/ |
52 | 27 | {%- endset -%} |
53 | 28 |
|
54 | | - {%- if execute -%} |
55 | | - {{- exceptions.warn(automate_dv.wrap_warning(message)) -}} |
56 | | - {%- endif -%} |
57 | | - |
| 29 | + {%- do automate_dv.log_warning(message) -%} |
58 | 30 | {%- endmacro -%} |
59 | 31 |
|
60 | 32 |
|
|
67 | 39 | Please see: https://automate-dv.readthedocs.io/en/latest/materialisations/ |
68 | 40 | {%- endset %} |
69 | 41 |
|
70 | | - {%- if execute -%} |
71 | | - {{- exceptions.raise_compiler_error(message) -}} |
72 | | - {%- endif -%} |
73 | | - |
| 42 | + {%- do automate_dv.log_warning(message) -%} |
74 | 43 | {%- endmacro -%} |
75 | 44 |
|
76 | 45 |
|
|
82 | 51 | Using this functionality in a live production setting may result in unpredictable outcomes, data loss, or system instability. |
83 | 52 | {%- endset -%} |
84 | 53 |
|
85 | | - {%- if execute -%} |
86 | | - {{- exceptions.warn(automate_dv.wrap_warning(message)) -}} |
87 | | - {%- endif -%} |
88 | | - |
| 54 | + {%- do automate_dv.log_warning(message) -%} |
89 | 55 | {%- endmacro -%} |
90 | 56 |
|
91 | 57 |
|
|
99 | 65 | We are actively working to get this fixed. Thank you for your understanding. |
100 | 66 | {%- endset -%} |
101 | 67 |
|
102 | | - {%- if execute -%} |
103 | | - {{- exceptions.raise_compiler_error(automate_dv.wrap_warning(message)) -}} |
104 | | - {%- endif -%} |
| 68 | + {%- do automate_dv.log_error(message) -%} |
| 69 | +{%- endmacro -%} |
| 70 | + |
| 71 | + |
| 72 | +{%- macro materialisation_deprecation_warning() -%} |
| 73 | + |
| 74 | + {%- set message -%} |
| 75 | + DEPRECATED: Since AutomateDV v0.11.0, vault_insert_by_x materialisations are now deprecated. |
| 76 | + These materialisation were initially designed to provide an option for rapid iterative development of |
| 77 | + incremental loading patterns in local environments for development and testing, allowing users to bypass |
| 78 | + the need for a comprehensive PSA or delta-loading solution. They are being deprecated to encourage the use |
| 79 | + of more robust solutions. |
| 80 | + {%- endset -%} |
| 81 | + |
| 82 | + {%- do automate_dv.log_warning(message) -%} |
| 83 | +{%- endmacro -%} |
| 84 | + |
| 85 | + |
| 86 | +{%- macro pit_bridge_deprecation_warning() -%} |
| 87 | + |
| 88 | + {%- set message -%} |
| 89 | + DEPRECATED: Since AutomateDV v0.11.0, the pit() and bridge() macros are now deprecated. |
| 90 | + This is because they are not currently fit-for-purpose and need significant usability |
| 91 | + and peformance improvements, as well as a design overhaul. |
| 92 | + Improved implementations will be released in a future version of AutomateDV. |
| 93 | + {%- endset -%} |
105 | 94 |
|
| 95 | + {%- do automate_dv.log_warning(message) -%} |
106 | 96 | {%- endmacro -%} |
0 commit comments