Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Many operations are lacking sanity checks #238

Closed
forman opened this issue May 22, 2017 · 0 comments
Closed

Many operations are lacking sanity checks #238

forman opened this issue May 22, 2017 · 0 comments

Comments

@forman
Copy link
Member

forman commented May 22, 2017

Expected behavior

A lot of our Python operations are lacking sanity checks and produce confusing stacktraces.

For example, all of our Python operations should raise ValueError with a dedicated message if a mandatory value is missing i.e. None has been passed to a non-nullable parameter.

Actual behavior

Unrelated exceptions are raised because within most operation's implementation code, illegal values, often None values are accessed without checking, or they are passed into lower level API where tey produce exceptions out of our control thereby increasing the length of the stacktrace.

This produces very confusing error messages for API/CLI/GUI users.

Implementation hints:

  1. Utilize Like.convert(nullable=True),
  2. in package cate.core.op provide function validate_op_input(op_name, input_name, actual_value) which has access to an input's property passed to @op_input

The selected approach should be documented in the developer guide (#77).

Steps to reproduce the problem

Call e.g. pearson_correlation with any of the mandatory inputs set to None.

Specifications

Cate 0.8.0rc2

@forman forman added this to the IPM5 milestone May 22, 2017
@JanisGailis JanisGailis modified the milestones: IPM6, IPM5 Jun 29, 2017
@forman forman closed this as completed in 43ae6e5 Jun 30, 2017
forman added a commit that referenced this issue Jun 30, 2017
@forman forman removed their assignment Jul 6, 2017
@JanisGailis JanisGailis removed their assignment Jul 8, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants