refactor: barrer anti-patterns dplyr/purrr (#39, scope acotado)#69
Merged
refactor: barrer anti-patterns dplyr/purrr (#39, scope acotado)#69
Conversation
Sprint B · Calidad técnica. Pasada mecánica para alinear el código a
las convenciones modernas tidyverse documentadas en
.claude/rules/r-conventions.md. Refactor sin cambio funcional: los
185 tests automatizados pasan igual antes y después.
Cambios:
- pmap_dfr / map_dfr → pmap()/map() |> list_rbind() (deprecados desde
purrr 1.0). 10 ocurrencias:
* ETL/04b-add_pp05_vars.R (descargas pp05)
* ETL/05-build_panel_cat_ocup.R
* ETL/06-build_panel_formalidad.R
* ETL/07-build_panel_formalidad_ampliada.R
* ETL/99-functions.R (regenerar_panel_historico, build_tasas_historico)
- group_by(X) |> mutate(...) |> ungroup() → mutate(..., .by = X)
(idiom moderno desde dplyr 1.1, evita state implícito de
agrupación). 2 ocurrencias en preparo_base() · ETL/99-functions.R.
- %>% magrittr → |> pipe nativo (R 4.1+). 3 líneas en
df_to_annotations_labels() · ETL/99-functions.R.
Diferidos a otro sprint (no abarca este PR):
- CSS muerto, perf con profvis, accesibilidad WCAG, dependencias
no usadas, refactor mod_analisis() genérico (#12).
Verificado: grep en R/ y ETL/ devuelve cero ocurrencias de los
patterns deprecated.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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.
Summary
Cierra parcialmente issue #39 (Sprint B · Calidad técnica). Pasada mecánica para alinear el código a las convenciones tidyverse modernas (ver
.claude/rules/r-conventions.md). Refactor sin cambio funcional.Cambios:
pmap_dfr/map_dfr(deprecated purrr 1.0)pmap()/map() \|> list_rbind()group_by(X) \|> mutate(...) \|> ungroup()mutate(..., .by = X)%>%magrittr\|>nativoArchivos tocados:
ETL/04b, 05, 06, 07-build_*.RyETL/99-functions.R.Diferido a otro sprint (no parte de este PR): CSS muerto, perf con profvis, accesibilidad WCAG, dependencias no usadas, refactor
mod_analisis()genérico (#12 / Sprint C).Test plan
🤖 Generated with Claude Code