From d283b854f47afc1cde64968a623306015344f1a6 Mon Sep 17 00:00:00 2001 From: Curt Da Silva Date: Thu, 11 Dec 2025 16:35:37 -0800 Subject: [PATCH 1/3] deps: Set `PrettyTables@3` fix(`show_diff`): Fix minor max num rows check --- ext/TestingUtilitiesDataFramesExt.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ext/TestingUtilitiesDataFramesExt.jl b/ext/TestingUtilitiesDataFramesExt.jl index 489890d..101417f 100644 --- a/ext/TestingUtilitiesDataFramesExt.jl +++ b/ext/TestingUtilitiesDataFramesExt.jl @@ -1,6 +1,8 @@ module TestingUtilitiesDataFramesExt using TestingUtilities, DataFrames, PrettyTables + using PrettyTables: TextHighlighter + const pretty_table_kwarg_keys = (:alignment, :backend, :cell_alignment, :cell_first_line_only, :compact_printing, :formatters, :header, :header_alignment, :header_cell_alignment, :limit_printing, :max_num_of_columns, :max_num_of_rows, :renderer, :row_labels, :row_label_alignment, :row_label_column_title, :row_number_column_title, :show_header, :show_row_number, :show_subheader, :title, :title_alignment) const pretty_table_kwarg_keys_text = (pretty_table_kwarg_keys..., :alignment_anchor_fallback, :alignment_anchor_fallback_override, :alignment_anchor_regex, :autowrap, :body_hlines, :body_hlines_format, :columns_width, :crop, :Crop_subheader, :continuation_row_alignment, :display_size, :ellipsis_line_skip, :equal_columns_width, :highlighters, :hlines, :linebreaks, :maximum_columns_width, :minimum_columns_width, :newline_at_end, :overwrite, :reserved_display_lines, :row_number_alignment, :show_omitted_cell_summary, :tf, :title_autowrap, :title_same_width_as_table, :vcrop_mode, :vlines, :border_crayon, :header_crayon, :omitted_cell_summary_crayon, :row_label_crayon, :row_label_header_crayon, :row_number_header_crayon, :subheader_crayon, :text_crayon, :title_crayon) @@ -32,7 +34,7 @@ module TestingUtilitiesDataFramesExt end struct TruncatedValue end - PrettyTables.compact_type_str(::Type{TruncatedValue}) = "" + PrettyTables._compact_type_str(::Type{TruncatedValue}) = "" function show_truncated_df(io::IO, df::AbstractDataFrame; max_num_rows_cols::Tuple{Int,Int} = TestingUtilities.show_df_max_nrows_ncols[], kwargs...) max_num_of_rows, max_num_of_columns = max.(1, max_num_rows_cols) @@ -62,10 +64,9 @@ module TestingUtilitiesDataFramesExt return _highlighters.f(data, i, j) end highlighter_fd = _highlighters.fd - highlighter_crayon = _highlighters.crayon - highlighters = Highlighter(highlighter_f, highlighter_fd, highlighter_crayon) + highlighters = TextHighlighter(highlighter_f, highlighter_fd) else - highlighters = Highlighter((data,i,j) -> false, crayon"white") + highlighters = TextHighlighter((data,i,j) -> false, crayon"white") end formatters = function(v,i,j) if i == truncate_to_rows + 1 @@ -86,7 +87,7 @@ module TestingUtilitiesDataFramesExt return _formatter(v,i,j) end end - return pretty_table(io, df_to_show; (k => v for (k, v) in pairs(kwargs) if k ∈ pretty_table_kwarg_keys_text)..., highlighters, formatters) + return pretty_table(io, df_to_show; (k => v for (k, v) in pairs(kwargs) if k ∈ pretty_table_kwarg_keys_text)..., highlighters=[highlighters], formatters=[formatters]) end function TestingUtilities.show_diff(::TestingUtilities.StructTypeCat, ctx::IOContext, expected::AbstractDataFrame, result::AbstractDataFrame; expected_name="expected", result_name="result", max_num_rows_cols::Tuple{Int,Int} = TestingUtilities.show_diff_df_max_nrows_ncols[], results_printer::Union{TestingUtilities.TestResultsPrinter, Nothing}=nothing, differing_cols_only::Bool=false, kwargs...) @@ -166,7 +167,7 @@ module TestingUtilitiesDataFramesExt end end - highlighters = Highlighter((data,i,j) -> j > 2, highlight_diff) + highlighters = TextHighlighter((data,i,j) -> j > 2, highlight_diff) formatters = (v, i, j) -> j == 1 && isnothing(v) ? "" : v println(ctx, "Reason: Mismatched values") for df in difference_dfs From 8b2646fac1640f23c01581b88c6dd0ee657c596b Mon Sep 17 00:00:00 2001 From: Curt Da Silva Date: Thu, 11 Dec 2025 16:50:35 -0800 Subject: [PATCH 2/3] fix --- .github/workflows/CI.yml | 2 +- .gitignore | 4 ++-- Project.toml | 2 +- ext/TestingUtilitiesDataFramesExt.jl | 4 ++-- src/settings.jl | 2 +- test/test_util/test_util.jl | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4d60187..411b480 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,7 +18,7 @@ jobs: version: - '1.6' - '1.9' - - '1.11' + - '1.12' - 'nightly' os: - ubuntu-latest diff --git a/.gitignore b/.gitignore index 43ff620..df3376d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ -/Manifest.toml -/docs/Manifest.toml +/Manifest*.toml +/docs/Manifest*.toml /docs/build/ *.code-workspace LocalPreferences.toml \ No newline at end of file diff --git a/Project.toml b/Project.toml index d0eb1c5..b199cb7 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,7 @@ Dates = "1.6" MLStyle = "0.4" OrderedCollections = "1.6" Preferences = "1" -PrettyTables = "2" +PrettyTables = "3" Test = "1.6" julia = "1.6" diff --git a/ext/TestingUtilitiesDataFramesExt.jl b/ext/TestingUtilitiesDataFramesExt.jl index 101417f..a0f0867 100644 --- a/ext/TestingUtilitiesDataFramesExt.jl +++ b/ext/TestingUtilitiesDataFramesExt.jl @@ -114,9 +114,9 @@ module TestingUtilitiesDataFramesExt end end end - length(differing_rows) == max_num_of_rows+1 && break + length(differing_rows) ≥ max_num_of_rows+1 && break end - if length(differing_rows) == max_num_of_rows+1 + if length(differing_rows) ≥ max_num_of_rows+1 pop!(differing_rows) has_more_differing_rows = true else diff --git a/src/settings.jl b/src/settings.jl index 04717d8..16d8a21 100644 --- a/src/settings.jl +++ b/src/settings.jl @@ -160,7 +160,7 @@ end reset_show_df_opts() = set_show_df_opts(; max_num_rows=_show_df_max_nrows_default(), max_num_cols=_show_df_max_ncols_default()) _show_diff_df_max_nrows_default() = 10 -_show_diff_df_max_ncols_default() = 10 +_show_diff_df_max_ncols_default() = 5 const show_diff_df_max_nrows_ncols = Ref((_show_diff_df_max_nrows_default(), _show_diff_df_max_ncols_default())) diff --git a/test/test_util/test_util.jl b/test/test_util/test_util.jl index c009796..88d8a23 100644 --- a/test/test_util/test_util.jl +++ b/test/test_util/test_util.jl @@ -9,7 +9,7 @@ macro test_throws_compat(ExceptionType, message, expr) end # Ensure consistent type printing for DateTime type, in interactive mode or in package tests -PrettyTables.compact_type_str(::Type{DateTime}) = "DateTime" +PrettyTables._compact_type_str(::Type{DateTime}) = "DateTime" @testset "Macro utilities" begin @test TestingUtilities.unwrap_if_quotenode(:x) == :x From 1ccdcf2cce1a43c0c3c8d42b049b96209942b818 Mon Sep 17 00:00:00 2001 From: Curt Da Silva Date: Thu, 11 Dec 2025 16:52:39 -0800 Subject: [PATCH 3/3] deps: Set min julia version to 1.10 --- .github/workflows/CI.yml | 4 ++-- Project.toml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 411b480..f4a9741 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -16,8 +16,8 @@ jobs: fail-fast: false matrix: version: - - '1.6' - - '1.9' + - '1.10' + - '1.11' - '1.12' - 'nightly' os: diff --git a/Project.toml b/Project.toml index b199cb7..3fe9bb2 100644 --- a/Project.toml +++ b/Project.toml @@ -19,13 +19,13 @@ TestingUtilitiesDataFramesExt = ["DataFrames", "PrettyTables"] [compat] DataFrames = "1" -Dates = "1.6" +Dates = "1.10" MLStyle = "0.4" OrderedCollections = "1.6" Preferences = "1" PrettyTables = "3" -Test = "1.6" -julia = "1.6" +Test = "1.10" +julia = "1.10" [extras] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"