frictionless-r icon indicating copy to clipboard operation
frictionless-r copied to clipboard

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

Open peterdesmet opened this issue 1 year ago • 1 comments
trafficstars

With #262 we plan to introduce a version(), a function that doesn't start with a verb. This is similar to some camtrapdp functions (version(), deployments(), etc.). The functions have the advantage that they can have an equivalent set function version()<-.

Frictionless currently has other verb-less functions, mainly resources() (and also example_package() and the private locale(), col_types(), ...).

For consistency, I think we then need:

version() # new
version()<- # new
resources()
schema() # currently not the case
create_schema() # creates a schema from a data frame, doesn't "get" it

The alternative is:

get_version() # new
set_version() # new
get_resources() # currently not the case
get_schema()
create_schema() # creates a schema from a data frame, doesn't "get" it

That alternative is less appealing to me. @PietrH @sannegovaert @damianooldoni thoughts?


If we implement this:

  • [ ] Rename get_schema() to schema()
  • [ ] Deprecate get_schema()
  • [ ] Rename private function get_resource() to resource()
  • [ ] Change description for GitHub issue label function:get

peterdesmet avatar Aug 29 '24 16:08 peterdesmet

I don't think we need to rename internal helpers, it's to our benefit that we avoid collisions there as much as possible. I have no issue with renaming get_schema() and get_resource(), but if we are retooling completely for a v2, then maybe we should consider packaging the frictionless object in such a way that these functions aren't needed for users to access these properties.

PietrH avatar Aug 30 '24 08:08 PietrH