Skip to content

Conversation

@kim
Copy link
Contributor

@kim kim commented Oct 19, 2023

Description of Changes

There is no guarantee that a named field is in the supplied table header, nor that it is in the row. Panicking at this location can be disastrous, while all call sites are inside Result already. So, return Result.

API and ABI

  • This is a breaking change to the module ABI
  • This is a breaking change to the module API
  • This is a breaking change to the ClientAPI
  • This is a breaking change to the SDK API

If the API is breaking, please state below what will break

Expected complexity level and risk

How complicated do you think these changes are? Grade on a scale from 1 to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex change.

1

There is no guarantee that a named field is in the supplied table
header, nor that it is in the row. Panicking at this location can be
disastrous, while all call sites are inside Result already. So, return
Result.
@mamcx mamcx merged commit fca6cf3 into master Oct 19, 2023

pub fn get(&self, col: &'a FieldExpr, header: &'a Header) -> &'a AlgebraicValue {
match col {
pub fn get(&self, col: &'a FieldExpr, header: &'a Header) -> Result<&'a AlgebraicValue, RelationError> {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@mamcx would know the details here more than I would. Ideally the compiler would ensure we never panic here, but this seems fine given that the callers return Result anyway.

jdetter pushed a commit that referenced this pull request Oct 31, 2023
There is no guarantee that a named field is in the supplied table
header, nor that it is in the row. Panicking at this location can be
disastrous, while all call sites are inside Result already. So, return
Result.
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.

5 participants