Skip to content

Conversation

@prasankh
Copy link
Member

  • Introduced OperatorSchemaYamlError, ForecastSchemaYamlError and ForecastInputDataError.
  • Made target_column and target_column mandatory.
  • Updated code with relevant errors.
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 29, 2023
Copy link
Member

@ahosler ahosler left a comment

Choose a reason for hiding this comment

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

Looks awesome, thank you!
A couple of questions about the schema we can resolve later

target_column:
type: string
required: true
default: target
Copy link
Member

Choose a reason for hiding this comment

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

Why did we remove this? I think it's used in the ads opctl init method

Copy link
Member

Choose a reason for hiding this comment

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

Correct I use default field when I build forecast specification yaml based by schema. For the required fields it is better to have some default values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay, reverted this default value.

target_category_columns:
type: list
required: false
required: true
Copy link
Member

Choose a reason for hiding this comment

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

Does the code break without specifying this series column? If so we should open a ticket to change that

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, It breaks and the error message is not meaningful hence made this mandatory.

Copy link
Member

Choose a reason for hiding this comment

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

@ahosler @prasankh let's open a ticket to fix this, as Allen suggested?

# validation
if not name:
raise ValueError(
raise OperatorSchemaYamlError(
Copy link
Member

Choose a reason for hiding this comment

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

Why do we want to change ValueError on the OperatorSchemaYamlError here? The function gets the name attribute, and if the name attribute not provided we just show a message that name is expected. I think switching to the OperatorSchemaYamlError might be a bit confusing, because we don't expect YAML here as input attribute. The same for the other places in the CMD. There are only two methods that expect a YAML as input attribute - run and verify.

Copy link
Member Author

Choose a reason for hiding this comment

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

Reverted these changes in cmd.py

target_column:
type: string
required: true
default: target
Copy link
Member

Choose a reason for hiding this comment

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

Correct I use default field when I build forecast specification yaml based by schema. For the required fields it is better to have some default values.

from ads.common.serializer import DataClassSerializable
from ads.opctl.operator.common.utils import _load_yaml_from_uri

from ..common.errors import OperatorSchemaYamlError
Copy link
Member

Choose a reason for hiding this comment

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

Let's use absolute imports for the operator level modules and classes.

from ads.opctl.operator.common.errors import OperatorSchemaYamlError 

We can use relative imports inside the particular operator, but for the core modules it would be better to use absolute imports.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done


from .common.utils import OperatorValidator

from .common.errors import OperatorSchemaYamlError
Copy link
Member

Choose a reason for hiding this comment

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

Let's replace this with absolute imports.

from ads.opctl.operator.common.utils import OperatorValidator from ads.opctl.operator.common.errors import OperatorSchemaYamlError 
Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@mrDzurb
Copy link
Member

mrDzurb commented Oct 9, 2023

Looks like there are some conflicts with the target branch. We will need to merge the feature/forecasting into this branch at first.

@prasankh prasankh force-pushed the feature/forecasting-exceptions branch from df7b726 to b8911c8 Compare October 10, 2023 08:59
@prasankh prasankh merged commit a03cd9c into feature/forecasting Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

4 participants