Skip to content

[R] Discussion: should we use {rlang} for condition handling? #30844

@asfimport

Description

@asfimport

Currently we have a mixture of base::stop() and rlang::abort() in the codebase. Should we make a deliberate choice to use one or the other?
If we decided to switch to {}rlang{}, we could:

  • change the codebase as we go along, switching from base functions ({}stop(), warning(), message(){} to their rlang equivalents abort(), warn(), inform()

  • make an addendum to STYLE.md on condition handling

    We could cover additional aspects of condition handling such as the wording of messages - for example, by using key words such as must or {}should{}.

    Please discuss direction and why. :)

    Note: the arrow R package already depends on rlang so any outcome will not result in additional dependencies.

    Update: given @paleolimbot's suggestion of the abort(glue)) pattern I think we should include in scope adding a dependency on and using {}glue{}. 

Reporter: Dragoș Moldovan-Grünfeld / @dragosmg

Related issues:

Note: This issue was originally created as ARROW-15359. Please see the migration documentation for further details.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions