Skip to content

Commit

Permalink
feat: make unknown field notification warning instead of info (Azure#…
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotzh authored Jun 6, 2023
1 parent d4041cb commit aee4f62
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 27 deletions.
1 change: 1 addition & 0 deletions sdk/ml/azure-ai-ml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
### Breaking Changes

### Other Changes
- Log level of unknown field notifications for pipeline nodes raised from INFO to WARNING.


## 1.7.2 (2023-05-18)
Expand Down
2 changes: 1 addition & 1 deletion sdk/ml/azure-ai-ml/azure/ai/ml/entities/_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def try_raise(
return self

if self._warnings:
module_logger.info("Warnings: %s" % str(self._warnings))
module_logger.warning("Warnings: %s" % str(self._warnings))

if not self.passed:
message = (
Expand Down
28 changes: 5 additions & 23 deletions sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@
import pytest
from devtools_testutils import AzureRecordedTestCase, is_live
from pipeline_job.e2etests.test_pipeline_job import assert_job_input_output_types
from test_utilities.utils import (
_PYTEST_TIMEOUT_METHOD,
assert_job_cancel,
omit_with_wildcard,
sleep_if_live,
)
from test_utilities.utils import _PYTEST_TIMEOUT_METHOD, assert_job_cancel, omit_with_wildcard, sleep_if_live

from azure.ai.ml import (
AmlTokenConfiguration,
Expand All @@ -29,28 +24,15 @@
dsl,
load_component,
)
from azure.ai.ml._utils._arm_id_utils import (
is_ARM_id_for_resource,
is_singularity_id_for_resource,
)
from azure.ai.ml.constants._common import (
ANONYMOUS_COMPONENT_NAME,
SINGULARITY_ID_FORMAT,
AssetTypes,
InputOutputModes,
)
from azure.ai.ml._utils._arm_id_utils import is_ARM_id_for_resource, is_singularity_id_for_resource
from azure.ai.ml.constants._common import ANONYMOUS_COMPONENT_NAME, SINGULARITY_ID_FORMAT, AssetTypes, InputOutputModes
from azure.ai.ml.constants._job.pipeline import PipelineConstants
from azure.ai.ml.dsl._group_decorator import group
from azure.ai.ml.dsl._load_import import to_component
from azure.ai.ml.entities import CommandComponent, CommandJob
from azure.ai.ml.entities import Component
from azure.ai.ml.entities import Component as ComponentEntity
from azure.ai.ml.entities import (
Data,
JobResourceConfiguration,
PipelineJob,
QueueSettings,
)
from azure.ai.ml.entities import Data, JobResourceConfiguration, PipelineJob, QueueSettings
from azure.ai.ml.exceptions import UnexpectedKeywordError, ValidationException
from azure.ai.ml.parallel import ParallelJob, RunFunction, parallel_run_function

Expand Down Expand Up @@ -1537,7 +1519,7 @@ def pipeline(component_in_number, component_in_path):
node1.compute = "cpu-cluster"

dsl_pipeline: PipelineJob = pipeline(10, job_input)
with patch("azure.ai.ml.entities._validation.module_logger.info") as mock_logging:
with patch("azure.ai.ml.entities._validation.module_logger.warning") as mock_logging:
_ = client.jobs.create_or_update(dsl_pipeline)
mock_logging.assert_called_with("Warnings: [jobs.node1.jeff_special_option: Unknown field.]")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
from marshmallow import ValidationError
from pytest_mock import MockFixture

from azure.ai.ml import Input, Output, MLClient, dsl, load_component, load_job
from azure.ai.ml import Input, MLClient, Output, dsl, load_component, load_job
from azure.ai.ml.constants._common import AssetTypes, InputOutputModes
from azure.ai.ml.entities import Choice, CommandComponent, PipelineJob
from azure.ai.ml.entities._validate_funcs import validate_job
from azure.ai.ml.exceptions import ValidationException, UserErrorException
from azure.ai.ml.exceptions import UserErrorException, ValidationException

from .._util import _PIPELINE_JOB_TIMEOUT_SECOND, SERVERLESS_COMPUTE_TEST_PARAMETERS

Expand Down Expand Up @@ -595,7 +595,7 @@ def pipeline(component_in_number, component_in_path):

dsl_pipeline: PipelineJob = pipeline(10, job_input)

with patch("azure.ai.ml.entities._validation.module_logger.info") as mock_logging:
with patch("azure.ai.ml.entities._validation.module_logger.warning") as mock_logging:
dsl_pipeline._validate(raise_error=True)
mock_logging.assert_called_with("Warnings: [jobs.node1.jeff_special_option: Unknown field.]")

Expand Down

0 comments on commit aee4f62

Please sign in to comment.