Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vars_funs interface in the R package to match the Python package #34

Merged

Conversation

jeancochrane
Copy link
Contributor

@jeancochrane jeancochrane commented Dec 3, 2024

This PR branches off of #32 to bring the R package up to parity with the changes that PR makes to the Python package. In particular:

  • Remove the unused vars_check_class function
  • Deprecate the type and dict params in vars_rename and vars_recode, and replace them with the new params {code|output}_type and dictionary

Since no code is currently using the vars_check_class function, we can safely remove it. Code is still using type and dict, however, so we implement deprecation with fallback so that that code will still work with the latest version of the package.

Note that there is more code that we could strip out of the R package, but I'm restricting the scope of this PR to only the changes that are necessary to create parity with the Python package as of #32.

jeancochrane and others added 30 commits November 20, 2024 13:39
@jeancochrane jeancochrane force-pushed the jeancochrane/strip-out-unused-vars-funs-from-R-package branch from 3d58789 to 8e3b5ba Compare December 3, 2024 20:04
@jeancochrane jeancochrane marked this pull request as ready for review December 3, 2024 20:08
@jeancochrane jeancochrane requested a review from a team as a code owner December 3, 2024 20:08
@jeancochrane jeancochrane requested a review from dfsnow December 3, 2024 20:09
Copy link
Member

@dfsnow dfsnow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @jeancochrane 👍 IMO we should just cut a new major version of this package once all the Python functions are merged and R functions updated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: IMO we can also remove the class_dict dataset that feeds this function, since it's now just a dbt seed that lives in data-architecture. I don't think it's used in any other major repos.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, done! I opened ccao-data/data-architecture#667 and ccao-data/ptaxsim#45 to fix the only references I could find outside this repo.

R/vars_funs.R Outdated
Comment on lines 85 to 93
if (!is.null(type)) {
warning("'type' is deprecated. Use 'output_type' instead.", call. = FALSE)
output_type <- type
}

if (!is.null(dict)) {
warning("'dict' is deprecated. Use 'dictionary' instead.", call. = FALSE)
dictionary <- dict
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (non-blocking): I recognize this is good practice, but I wonder about the utility of including lifecycle code like this in a strictly internal package. My preference would be to just release a new major version with the breaking changes included. Ultimately I defer to you @jeancochrane, as my view here isn't super strongly held.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, I stripped out this logic in 3d94d7e.

Base automatically changed from jeancochrane/further-python-package-migration to master December 4, 2024 22:16
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (969dae7) to head (f10de4e).
Report is 6 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #34   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines          382       377    -5     
=========================================
- Hits           382       377    -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jeancochrane jeancochrane merged commit 6445f79 into master Dec 6, 2024
15 checks passed
@jeancochrane jeancochrane deleted the jeancochrane/strip-out-unused-vars-funs-from-R-package branch December 6, 2024 22:01
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.

2 participants