@@ -8886,9 +8886,11 @@ def get_step_report(
88868886 column selector expressions don't resolve to any columns.
88878887 header
88888888 Options for customizing the header of the step report. The default is the `":default:"`
8889- value which produces a generic header. Aside from this default, text can be provided for
8890- the header. This will be interpreted as Markdown text and transformed internally to
8891- HTML.
8889+ value which produces a header with a standard title and set of details underneath. Aside
8890+ from this default, free text can be provided for the header. This will be interpreted as
8891+ Markdown text and transformed internally to HTML. You can provide one of two templating
8892+ elements: `{title}` and `{details}`. The default header has the template
8893+ `"{title}{details}"` so you can easily start from that and modify as you see fit.
88928894 limit
88938895 The number of rows to display for those validation steps that check values in rows (the
88948896 `col_vals_*()` validation steps). The default is `10` rows and the limit can be removed
@@ -10632,23 +10634,6 @@ def _step_report_schema_in_order(
1063210634 if debug_return_df :
1063310635 return schema_combined
1063410636
10635- # Get the other parameters for the `col_schema_match()` function
10636- case_sensitive_colnames = schema_info ["params" ]["case_sensitive_colnames" ]
10637- case_sensitive_dtypes = schema_info ["params" ]["case_sensitive_dtypes" ]
10638- full_match_dtypes = schema_info ["params" ]["full_match_dtypes" ]
10639-
10640- # Generate text for the `col_schema_match()` parameters
10641- col_schema_match_params_html = _create_col_schema_match_params_html (
10642- complete = complete ,
10643- in_order = True ,
10644- case_sensitive_colnames = case_sensitive_colnames ,
10645- case_sensitive_dtypes = case_sensitive_dtypes ,
10646- full_match_dtypes = full_match_dtypes ,
10647- )
10648-
10649- # Get the passing symbol for the step
10650- passing_symbol = CHECK_MARK_SPAN if all_passed else CROSS_MARK_SPAN
10651-
1065210637 step_report = (
1065310638 GT (schema_combined , id = "pb_step_tbl" )
1065410639 .fmt_markdown (columns = None )
@@ -10737,15 +10722,6 @@ def _step_report_schema_in_order(
1073710722 .tab_options (source_notes_font_size = "12px" )
1073810723 )
1073910724
10740- if header == ":default:" :
10741- step_report = step_report .tab_header (
10742- title = html (f"Report for Validation Step { step } { passing_symbol } " ),
10743- subtitle = html (col_schema_match_params_html ),
10744- )
10745-
10746- else :
10747- step_report = step_report .tab_header (title = md (header ))
10748-
1074910725 if schema_length == "shorter" :
1075010726 # Add background color to the missing column on the exp side
1075110727 step_report = step_report .tab_style (
@@ -10786,6 +10762,39 @@ def _step_report_schema_in_order(
1078610762 if version ("great_tables" ) >= "0.17.0" :
1078710763 step_report = step_report .tab_options (quarto_disable_processing = True )
1078810764
10765+ # Get the other parameters for the `col_schema_match()` function
10766+ case_sensitive_colnames = schema_info ["params" ]["case_sensitive_colnames" ]
10767+ case_sensitive_dtypes = schema_info ["params" ]["case_sensitive_dtypes" ]
10768+ full_match_dtypes = schema_info ["params" ]["full_match_dtypes" ]
10769+
10770+ # Get the passing symbol for the step
10771+ passing_symbol = CHECK_MARK_SPAN if all_passed else CROSS_MARK_SPAN
10772+
10773+ # Generate the title for the step report
10774+ title = f"Report for Validation Step { step } { passing_symbol } "
10775+
10776+ # Generate the details for the step report
10777+ details = _create_col_schema_match_params_html (
10778+ complete = complete ,
10779+ in_order = True ,
10780+ case_sensitive_colnames = case_sensitive_colnames ,
10781+ case_sensitive_dtypes = case_sensitive_dtypes ,
10782+ full_match_dtypes = full_match_dtypes ,
10783+ )
10784+
10785+ # Generate the default template text for the header when `":default:"` is used
10786+ if header == ":default:" :
10787+ header = "{title}{details}"
10788+
10789+ # Use commonmark to convert the header text to HTML
10790+ header = commonmark .commonmark (header )
10791+
10792+ # Place any templated text in the header
10793+ header = header .format (title = title , details = details )
10794+
10795+ # Create the header with `header` string
10796+ step_report = step_report .tab_header (title = md (header ))
10797+
1078910798 return step_report
1079010799
1079110800
@@ -11051,23 +11060,6 @@ def _step_report_schema_any_order(
1105111060 if debug_return_df :
1105211061 return schema_combined
1105311062
11054- # Get the other parameters for the `col_schema_match()` function
11055- case_sensitive_colnames = schema_info ["params" ]["case_sensitive_colnames" ]
11056- case_sensitive_dtypes = schema_info ["params" ]["case_sensitive_dtypes" ]
11057- full_match_dtypes = schema_info ["params" ]["full_match_dtypes" ]
11058-
11059- # Generate text for the `col_schema_match()` parameters
11060- col_schema_match_params_html = _create_col_schema_match_params_html (
11061- complete = complete ,
11062- in_order = False ,
11063- case_sensitive_colnames = case_sensitive_colnames ,
11064- case_sensitive_dtypes = case_sensitive_dtypes ,
11065- full_match_dtypes = full_match_dtypes ,
11066- )
11067-
11068- # Get the passing symbol for the step
11069- passing_symbol = CHECK_MARK_SPAN if all_passed else CROSS_MARK_SPAN
11070-
1107111063 step_report = (
1107211064 GT (schema_combined , id = "pb_step_tbl" )
1107311065 .fmt_markdown (columns = None )
@@ -11157,15 +11149,6 @@ def _step_report_schema_any_order(
1115711149 .tab_options (source_notes_font_size = "12px" )
1115811150 )
1115911151
11160- if header == ":default:" :
11161- step_report = step_report .tab_header (
11162- title = html (f"Report for Validation Step { step } { passing_symbol } " ),
11163- subtitle = html (col_schema_match_params_html ),
11164- )
11165-
11166- else :
11167- step_report = step_report .tab_header (title = md (header ))
11168-
1116911152 # Add background color to signify limits of target table schema (on LHS side)
1117011153 if len (colnames_exp_unmatched ) > 0 :
1117111154 step_report = step_report .tab_style (
@@ -11184,6 +11167,39 @@ def _step_report_schema_any_order(
1118411167 if version ("great_tables" ) >= "0.17.0" :
1118511168 step_report = step_report .tab_options (quarto_disable_processing = True )
1118611169
11170+ # Get the other parameters for the `col_schema_match()` function
11171+ case_sensitive_colnames = schema_info ["params" ]["case_sensitive_colnames" ]
11172+ case_sensitive_dtypes = schema_info ["params" ]["case_sensitive_dtypes" ]
11173+ full_match_dtypes = schema_info ["params" ]["full_match_dtypes" ]
11174+
11175+ # Get the passing symbol for the step
11176+ passing_symbol = CHECK_MARK_SPAN if all_passed else CROSS_MARK_SPAN
11177+
11178+ # Generate the title for the step report
11179+ title = f"Report for Validation Step { step } { passing_symbol } "
11180+
11181+ # Generate the details for the step report
11182+ details = _create_col_schema_match_params_html (
11183+ complete = complete ,
11184+ in_order = False ,
11185+ case_sensitive_colnames = case_sensitive_colnames ,
11186+ case_sensitive_dtypes = case_sensitive_dtypes ,
11187+ full_match_dtypes = full_match_dtypes ,
11188+ )
11189+
11190+ # Generate the default template text for the header when `":default:"` is used
11191+ if header == ":default:" :
11192+ header = "{title}{details}"
11193+
11194+ # Use commonmark to convert the header text to HTML
11195+ header = commonmark .commonmark (header )
11196+
11197+ # Place any templated text in the header
11198+ header = header .format (title = title , details = details )
11199+
11200+ # Create the header with `header` string
11201+ step_report = step_report .tab_header (title = md (header ))
11202+
1118711203 return step_report
1118811204
1118911205
0 commit comments