Skip to content

🥅 Handles zero-row tables more elegantly - #215

Closed
francisbarton wants to merge 328 commits into
v1.2from
fb/issue178
Closed

🥅 Handles zero-row tables more elegantly#215
francisbarton wants to merge 328 commits into
v1.2from
fb/issue178

Conversation

@francisbarton

@francisbarton francisbarton commented Aug 26, 2026

Copy link
Copy Markdown
Member

This PR:

  • adds functions that help return a zero-row tibble with the same columns and data classes as the tibble that is returned when the function is successful. This could happen, for example, if a filter to site codes includes non-existent/inapplicable site codes, or if a non-existent combination of parameters is supplied (eg activity type = "op" and measure = "admissions"). This helps reduce the surface for potentially deeply-buried or cryptic error messages. These guards are applied in appropriate places in the data preparation functions. The 0-row tibbles are returned with a "reason" attribute that can be read by error-handling functions that return a message.
  • zero-row behaviour guards are also implemented in the various table and plot creation functions, so that instead of erroring they will produce a simple almost blank table or plot with the reason displayed.
  • a suite of tests for these behaviours is also introduced

The concepts behind the execution of these guard functions and messaging outputs were generated by an LLM, but the code has since been examined and updated by me. The package at the point of this PR passes devtools::check().

🩼 Helper functions and utlities
Should close #46
Use check_container_class function from azkit
@francisbarton
francisbarton force-pushed the fb/issue178 branch 3 times, most recently from 62e8a6f to 526ddd6 Compare September 2, 2026 12:49
@francisbarton
francisbarton changed the base branch from main to v1.2 September 3, 2026 13:42
@francisbarton
francisbarton marked this pull request as ready for review September 3, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants