Changelog
legihelpR (development version)
Compatibility: empty
getMasterListRaw()andgetMonitorListRaw()results now have typed columns matching their documented API fields, rather than zero columns. Usenrow(x) == 0to detect no bills;length(x) == 0,ncol(x) == 0, and column-presence checks no longer detect emptiness. Nonempty responses and API error handling are unchanged.Vignette API examples are explicitly unevaluated so extracted code does not make live requests during package checks.
setlegiKey(install = TRUE)now separates the new assignment from an existing final line without a newline, preserving existing settings and ensuring the key is not swallowed by a comment.Search functions now collect pages before combining results, avoiding repeated copies of previously fetched rows while preserving result order and columns.
Search functions now validate
query,page, andmaxPagesbefore making quota-consuming requests, and session-scoped searches omit incompatible state and year filters.getDataset()now supports LegiScan’sformatparameter; both dataset download functions acceptjsonorcsvcase-insensitively and reject invalid formats before making a request.API response and key validation now handle malformed values cleanly without including a supplied key in error logs.
setlegiKey()matches only actuallegiKey=entries in.Renviron, checks setup and backup failures, and safely quotes the stored value.Document and sponsored-session messages now use fields present in LegiScan’s documented response schema.
getDatasetRaw()now takesformatafterlegiKey, matching the argument order ofgetDataset(). Positional calls that passedformatthird must be updated to name the argument.Internal request building no longer uses R’s native pipe. This is a style change only:
httr2anddplyrboth require R >= 4.1, so the package’s effective minimum R version is unchanged.Expanded offline regression coverage and declared the testthat version used by the test helpers.
legihelpR 0.3.2
-
legiSearch()andlegiSearchRaw()now return a zero-row data frame with the documented columns, instead ofNULL, when a search matches nothing. The “No results found” warning is unchanged. Downstream code can callnrow(), select columns, or bind results without special-casing empty searches; existingis.null()guards will no longer trigger. -
maxPagesinlegiSearch()andlegiSearchRaw()now caps the number of pages fetched, as documented, rather than acting as a maximum page number. Behavior only changes when paginating from a custom startingpage> 1. -
legiSearchRaw()no longer errors (“argument is of length zero”) when a response arrives without asummary$page_total; it stops paginating and returns what it collected. -
legiSearch()drops thesummaryblock from responses by name rather than by position, matchinggetMasterList(), so a reordered response can never silently discard a result row. -
legiSearch()usessummary$page_totalto detect the final page instead of the “fewer than 50 rows” heuristic, which spent one extra API query whenever the result count was an exact multiple of the page size. -
getMasterList()no longer emits a blank message when a response has nosessionblock. -
DESCRIPTIONnow declares the requiredhttr2 (>= 1.1.0)and drops the unusedLazyDatafield.
legihelpR 0.3.1
- Renamed function arguments to a consistent camelCase ID convention (e.g.
billID,sessionID,peopleID,legiKey). - Document functions (
getText(),getAmendment(),getSupplement(),getDataset()) gained afileargument to decode base64 documents to disk. - Search pagination is capped with
maxPages(default 10) to protect API quota; useInfto fetch every page. - Added a change-detection vignette.