Skip to content

feat: Add unit tests for forecast operator API options #1237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ahosler
Copy link
Member

@ahosler ahosler commented Jul 31, 2025

This commit introduces a new test file, tests/operators/forecast/test_api_options.py, which includes tests for several previously untested API options in the forecast operator. The goal of these tests is to improve the test coverage of the operator and ensure that all options are working as expected.

The following options are now covered by unit tests:

  • report_filename
  • metrics_filename
  • test_metrics_filename
  • forecast_filename
  • report_theme
  • generate_report
  • previous_output_dir
  • generate_model_parameters
  • generate_model_pickle
  • confidence_interval_width
  • tuning
  • metric
  • preprocessing.steps.outlier_treatment
  • preprocessing.steps.missing_value_imputation

In addition to adding new tests, this commit also updates the docstrings in ads/opctl/operator/lowcode/forecast/operator_config.py to provide more detailed explanations of the available API options.

Note: I was unable to run the tests successfully due to a series of missing dependencies in the environment. I have been incrementally installing the missing packages, but I am currently blocked by an issue with the distutils module, which has been removed in Python 3.12. I have started to address this by replacing the import of distutils.dir_util with shutil in ads/common/model.py, but I have not been able to fully replace its usage. Further work is required to resolve these environment issues and run the tests to verify the changes.

This commit introduces a new test file, `tests/operators/forecast/test_api_options.py`, which includes tests for several previously untested API options in the forecast operator. The goal of these tests is to improve the test coverage of the operator and ensure that all options are working as expected.

The following options are now covered by unit tests:
- `report_filename`
- `metrics_filename`
- `test_metrics_filename`
- `forecast_filename`
- `report_theme`
- `generate_report`
- `previous_output_dir`
- `generate_model_parameters`
- `generate_model_pickle`
- `confidence_interval_width`
- `tuning`
- `metric`
- `preprocessing.steps.outlier_treatment`
- `preprocessing.steps.missing_value_imputation`

In addition to adding new tests, this commit also updates the docstrings in `ads/opctl/operator/lowcode/forecast/operator_config.py` to provide more detailed explanations of the available API options.

**Note:** I was unable to run the tests successfully due to a series of missing dependencies in the environment. I have been incrementally installing the missing packages, but I am currently blocked by an issue with the `distutils` module, which has been removed in Python 3.12. I have started to address this by replacing the import of `distutils.dir_util` with `shutil` in `ads/common/model.py`, but I have not been able to fully replace its usage. Further work is required to resolve these environment issues and run the tests to verify the changes.
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. label Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant