Skip to content

Commit 946d765

Browse files
authored
change dev requirements to see if fix works (Azure#39042)
1 parent 19f4ccb commit 946d765

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/_schema/core/fields.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from marshmallow import RAISE, fields
1818
from marshmallow.exceptions import ValidationError
19-
from marshmallow.fields import _T, Field, Nested
19+
from marshmallow.fields import Field, Nested
2020
from marshmallow.utils import FieldInstanceResolutionError, from_iso_datetime, resolve_field_instance
2121

2222
from ..._utils._arm_id_utils import AMLVersionedArmId, is_ARM_id_for_resource, parse_name_label, parse_name_version
@@ -44,6 +44,7 @@
4444
from ..core.schema import PathAwareSchema
4545

4646
module_logger = logging.getLogger(__name__)
47+
T = typing.TypeVar("T")
4748

4849

4950
class StringTransformedEnum(Field):
@@ -830,7 +831,7 @@ def _validate(self, value):
830831
class DumpableIntegerField(fields.Integer):
831832
"""A int field that cannot serialize other type of values to int if self.strict."""
832833

833-
def _serialize(self, value, attr, obj, **kwargs) -> typing.Optional[typing.Union[str, _T]]:
834+
def _serialize(self, value, attr, obj, **kwargs) -> typing.Optional[typing.Union[str, T]]:
834835
if self.strict and not isinstance(value, int):
835836
# this implementation can serialize bool to bool
836837
raise self.make_error("invalid", input=value)
@@ -856,14 +857,14 @@ def _validated(self, value):
856857
raise self.make_error("invalid", input=value)
857858
return super()._validated(value)
858859

859-
def _serialize(self, value, attr, obj, **kwargs) -> typing.Optional[typing.Union[str, _T]]:
860+
def _serialize(self, value, attr, obj, **kwargs) -> typing.Optional[typing.Union[str, T]]:
860861
return super()._serialize(self._validated(value), attr, obj, **kwargs)
861862

862863

863864
class DumpableStringField(fields.String):
864865
"""A string field that cannot serialize other type of values to string if self.strict."""
865866

866-
def _serialize(self, value, attr, obj, **kwargs) -> typing.Optional[typing.Union[str, _T]]:
867+
def _serialize(self, value, attr, obj, **kwargs) -> typing.Optional[typing.Union[str, T]]:
867868
if not isinstance(value, str):
868869
raise ValidationError("Given value is not a string")
869870
return super()._serialize(value, attr, obj, **kwargs)

sdk/ml/azure-ai-ml/dev_requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-e ../../../tools/azure-sdk-tools
22
../../core/azure-core
33
../../identity/azure-identity
4-
marshmallow<3.20
4+
marshmallow
55
marshmallow-jsonschema==0.10.0
66
mock
77
pytest-cov

0 commit comments

Comments
 (0)