Skip to content

Add status = "lent" to alepe_staff(); report invalid status as an error - #1

Merged
milkway merged 4 commits into
mainfrom
staff-lent-status
Sep 29, 2026
Merged

milkway merged 4 commits into
mainfrom
staff-lent-status

Conversation

@milkway

@milkway milkway commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

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 status surfaced as a network warning

map_status() was passed straight into alepe_fetch_json(). Lazy evaluation ran it inside the fetch layer's error handler, so alepe_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"

/servidores documents a fourth vinculo value, efetivo-cedido: the Assembly's own permanent staff lent to other bodies (6 people today). They are published with VINCULO = "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".

/cargos ignores the value and returns the unfiltered table, so alepe_positions() rejects "lent" rather than pretending to filter. Rationale and naming in D22 (local notes).

Also commits the pending .Rbuildignore entries for .Rproj, .Rproj.user and CRAN-SUBMISSION.

devtools::check(): 0 errors, 0 warnings, 0 notes. Version is 0.1.0.9000. The bump to 0.1.1 comes at release time.

Python twin: StrategicProjects/alepe_py (same change).

🤖 Generated with Claude Code

André Leite and others added 4 commits September 29, 2026 19:01
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>
@milkway
milkway merged commit 3031c26 into main Sep 29, 2026
5 checks passed
@milkway
milkway deleted the staff-lent-status branch September 29, 2026 22:46
@milkway milkway mentioned this pull request Sep 29, 2026
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.

1 participant