Skip to content

Conversation

peterdesmet
Copy link
Member

@peterdesmet peterdesmet commented Sep 24, 2025

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
Copy link

codecov bot commented Sep 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (34a2d01) to head (bb35a0f).

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
Member Author

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

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()
1 participant