Skip to content

Create add_properties() function - #382

Merged
peterdesmet merged 17 commits into
mainfrom
add_property
Sep 17, 2026
Merged

peterdesmet merged 17 commits into
mainfrom
add_property

Conversation

@peterdesmet

Copy link
Copy Markdown
Member

This function is the result of a discussion on how to best support an append()-like function. This implementation has several advantages:

  • Does not mask base append()
  • Works on all frictionless list objects (package, resource, dialect, schema), not just package
  • Can deviate from append() functionality and arguments. E.g. the to-be-added elements are not provided in a single argument values but in ...

Implementation details

  • The function returns an error if arguments provided in ... are not named. This is done with helper function check_dots() (a renamed get_dot_names()) which is also used by add_resource()
  • The function replaces the internal helper append_with_attributes(). Many of its tests were kept.
  • The function is mentioned in all vignettes. Phrasing that frictionless does not support list manipulation is removed and the append() example in frictionless.Rmd replaced.

Relation to issues

@peterdesmet peterdesmet added this to the v2.0.0 milestone Sep 16, 2026
@codecov

codecov Bot commented Sep 16, 2026 •

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #382   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           28        29    +1     
  Lines          827       833    +6     
=========================================
+ Hits           827       833    +6     

☔ View full report in Codecov by Harness.
📢 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.

@sannegovaert sannegovaert 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.

I really like add_properties(), it is so elegant!

Comment thread R/add_properties.R
Comment thread R/add_properties.R Outdated
#' position of the added element.
#'
#' `add_resource()` also supports adding metadata properties to a Data Resource,
#' and checks for reserved properties.

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.

What do you mean with reserved?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Properties that are automatically set by add_resource(). Would the following be clearer?

add_resource() also supports adding metadata properties to a Data Resource, except those automatically set by that function.

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.

Yes!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated, also in vignette: a177894

Comment thread R/add_resource.R
Comment thread vignettes/table-dialect.Rmd Outdated
peterdesmet and others added 2 commits September 17, 2026 10:10
Co-authored-by: Sanne Govaert <44606923+sannegovaert@users.noreply.github.com>
@peterdesmet
peterdesmet merged commit 5c688df into main Sep 17, 2026
9 checks passed
@peterdesmet
peterdesmet deleted the add_property branch September 17, 2026 08:35
@peterdesmet peterdesmet removed this from the v2.0.0 milestone Sep 29, 2026
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.

append() drops custom datapackage class Create function add_metadata() or add_property()

2 participants