Skip to content

Rename functions#282

Merged
peterdesmet merged 9 commits into
mainfrom
rename
Oct 8, 2025
Merged

Rename functions#282
peterdesmet merged 9 commits into
mainfrom
rename

Conversation

@peterdesmet

@peterdesmet peterdesmet commented Sep 24, 2025

Copy link
Copy Markdown
Member

Fix #263

Our functions all start with a verb, which makes sense, because they perform an action (read, create, remove).

That is less the case for accessor functions (which have a generic "get"). That is why it's more intuitive to just call them after the thing, e.g. schema() rather than get_schema(). We already did this with resources(), which is better named resource_names() as that is what it returns. Future accessor functions could include version().

This PR therefore renames:

  1. get_schema()schema(): a public accessor function => deprecation
  2. resources()resource_names(): a public read accessor function => deprecation
  3. get_resource()resource(): a private accessor function => no deprecation

The filename for print.R is also renamed to print.datapackage.R in preparation for print functions for schema() and resource().

@peterdesmet peterdesmet added this to the 1.3.0 milestone Sep 24, 2025
@peterdesmet peterdesmet added function:accessor Accessor functions schema(), resource(), resource_names() function:print Function print.datapackage() labels Sep 24, 2025
@codecov

codecov Bot commented Sep 24, 2025

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (34a2d01) to head (bb35a0f).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #282   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        23    +1     
  Lines          638       650   +12     
=========================================
+ Hits           638       650   +12     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peterdesmet

Copy link
Copy Markdown
Member Author

Right, I forgot tests for my deprecated functions. Will add that.

@damianooldoni damianooldoni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good work. Everything done as it should by using lifecycle R package both in functions and in tests. 👍

@peterdesmet peterdesmet merged commit c6323d9 into main Oct 8, 2025
9 checks passed
@peterdesmet peterdesmet deleted the rename branch October 8, 2025 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

function:accessor Accessor functions schema(), resource(), resource_names() function:print Function print.datapackage()

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename get_schema() (and helper functions) to schema()

2 participants