File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7676 {% endif %}
7777
7878 {% if disable_test_samples %} {% set sample_limit = 0 %}
79- {% elif elementary .is_pii_table (flattened_test) %} {% set sample_limit = 0 %}
80- {% elif elementary .should_disable_sampling_for_pii (flattened_test) %}
81- {% set sample_limit = 0 %}
79+ {% elif not elementary .is_show_sample_rows_table (flattened_test) %}
80+ {% if elementary .is_pii_table (flattened_test) %} {% set sample_limit = 0 %}
81+ {% elif elementary .should_disable_sampling_for_pii (flattened_test) %}
82+ {% set sample_limit = 0 %}
83+ {% endif %}
8284 {% endif %}
8385
8486 {% set result_rows = elementary .query_test_result_rows (
Original file line number Diff line number Diff line change 143143 " anomaly_exclude_metrics" : none,
144144 " disable_samples_on_pii_tags" : false,
145145 " pii_tags" : [" pii" ],
146+ " enable_samples_on_show_sample_rows_tags" : false,
147+ " show_sample_rows_tags" : [" show_sample_rows" ],
146148 " bigquery_disable_partitioning" : false,
147149 " bigquery_disable_clustering" : false,
148150 " upload_only_current_project_artifacts" : false,
Original file line number Diff line number Diff line change 3838 {% set column_nodes = parent_model .get (" columns" ) %}
3939 {% if not column_nodes %} {% do return(pii_columns) %} {% endif %}
4040
41+ {% set enable_show_tags = elementary .get_config_var (" enable_samples_on_show_sample_rows_tags" ) %}
42+ {% set raw_show_tags = elementary .get_config_var (" show_sample_rows_tags" ) %}
43+ {% set show_tags = (
44+ (raw_show_tags if raw_show_tags is iterable else [raw_show_tags])
45+ | map(" lower" ) | list
46+ ) %}
47+
4148 {% for column_node in column_nodes .values () %}
4249 {% set all_column_tags_lower = elementary .get_column_tags (column_node) %}
4350
51+ {# Skip columns explicitly tagged to show sample rows (if feature is enabled) #}
52+ {% if enable_show_tags and elementary .lists_intersection (all_column_tags_lower, show_tags) | length > 0 %}
53+ {% continue %}
54+ {% endif %}
55+
4456 {% for pii_tag in pii_tags %}
4557 {% if pii_tag in all_column_tags_lower %}
4658 {% do pii_columns .append (column_node .get (" name" )) %} {% break %}
Original file line number Diff line number Diff line change 1+ {% macro is_show_sample_rows_table(flattened_test) %}
2+ {% if not elementary .get_config_var (" enable_samples_on_show_sample_rows_tags" ) %}
3+ {% do return(false) %}
4+ {% endif %}
5+
6+ {% set raw_show_tags = elementary .get_config_var (" show_sample_rows_tags" ) %}
7+ {% set show_tags = (
8+ (raw_show_tags if raw_show_tags is iterable else [raw_show_tags])
9+ | map(" lower" )
10+ | list
11+ ) %}
12+
13+ {% set raw_model_tags = elementary .insensitive_get_dict_value (
14+ flattened_test, " model_tags" , []
15+ ) %}
16+ {% set model_tags = (
17+ (raw_model_tags if raw_model_tags is iterable else [raw_model_tags])
18+ | map(" lower" )
19+ | list
20+ ) %}
21+
22+ {% set intersection = elementary .lists_intersection (model_tags, show_tags) %}
23+ {% do return(intersection | length > 0 ) %}
24+ {% endmacro %}
You can’t perform that action at this time.
0 commit comments