Repository navigation
Add status = "lent" to alepe_staff(); report invalid status as an error - #1
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
map_status() was passed straight into alepe_fetch_json(), where lazy evaluation ran it inside the fetch layer's error handler. An invalid status therefore surfaced as 'API could not be reached' plus an empty tibble instead of the documented input error. Resolve it first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The /servidores endpoint accepts vinculo=efetivo-cedido: the Assembly's own permanent staff lent to other bodies. They are published with VINCULO "Efetivo", so only the server-side filter can single them out. /cargos ignores the value and returns every status, so alepe_positions() rejects it instead of pretending to filter (D22). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome of a live-API review on 2026-09-29: endpoints, field names and types are unchanged since the August verification (D14), and every NA traces back to a value missing in the payload. Two changes came out of it.
Bug: invalid
statussurfaced as a network warningmap_status()was passed straight intoalepe_fetch_json(). Lazy evaluation ran it inside the fetch layer's error handler, soalepe_staff(status = "nope")warned "The ALEPE open data API could not be reached" and returned an empty tibble instead of the documented input error. This is in 0.1.0 on CRAN. The status is now resolved before the fetch.Feature:
status = "lent"/servidoresdocuments a fourthvinculovalue,efetivo-cedido: the Assembly's own permanent staff lent to other bodies (6 people today). They are published withVINCULO = "Efetivo", so unlike the API's other filters (party, position, year, modality...), a client-side filter cannot reproduce it.alepe_staff()now accepts"lent"/"efetivo-cedido"./cargosignores the value and returns the unfiltered table, soalepe_positions()rejects"lent"rather than pretending to filter. Rationale and naming in D22 (local notes).Also commits the pending
.Rbuildignoreentries for.Rproj,.Rproj.userandCRAN-SUBMISSION.devtools::check(): 0 errors, 0 warnings, 0 notes. Version is0.1.0.9000. The bump to 0.1.1 comes at release time.Python twin: StrategicProjects/alepe_py (same change).
🤖 Generated with Claude Code