Azure / Azure/azure-sdk-for-python

Many warnings about Marshmallow 4 migration

Open
#43,208 3 comments 4 reactions 1 assignee Claimed by @kshitij-microsoft View on GitHub
Client customer-reported Machine Learning needs-team-attention question Service Attention
Dominant language
Python
Stars
5.6k
Forks
3.4k
Avg merge
1d 21h
Merged PRs (30d)
193

Description

Hi — i'm getting almost 500 warnings from just importing the `azure-ai-ml` package (1.29.0, Python 3.12) due to Marshmallow deprecation warnings. I think #41815 is the resolution for this, but I just wanted to bring it to your attention again as something very verbose that I've encountered!

Example:

```
.venv/lib/python3.12/site-packages/marshmallow/schema.py:129: 435 warnings
/tmp/.venv/lib/python3.12/site-packages/marshmallow/schema.py:129: RemovedInMarshmallow4Warning: The `ordered` `class Meta` option is deprecated. Field order is already preserved by default. Set `Schema.dict_class` to OrderedDict to maintain the previous behavior.
klass.opts = klass.OPTIONS_CLASS(meta, ordered=ordered)

.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/component/input_output.py:122
/tmp/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/component/input_output.py:122: ChangedInMarshmallow4Warning: `Number` field should not be instantiated. Use `Integer`, `Float`, or `Decimal` instead.
default = UnionField([fields.Str(), fields.Number(), fields.Bool()])

.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/component/input_output.py:124
/tmp/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/component/input_output.py:124: ChangedInMarshmallow4Warning: `Number` field should not be instantiated. Use `Integer`, `Float`, or `Decimal` instead.
max = UnionField([fields.Str(), fields.Number()])

.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/component/input_output.py:125
/tmp/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/component/input_output.py:125: ChangedInMarshmallow4Warning: `Number` field should not be instantiated. Use `Integer`, `Float`, or `Decimal` instead.
min = UnionField([fields.Str(), fields.Number()])

.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/_sweep/sweep_sampling_algorithm.py:30
/tmp/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/_sweep/sweep_sampling_algorithm.py:30: ChangedInMarshmallow4Warning: `Number` field should not be instantiated. Use `Integer`, `Float`, or `Decimal` instead.
fields.Number(),

.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/assets/index.py:17
/tmp/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/assets/index.py:17: RemovedInMarshmallow4Warning: The 'default' argument to fields is deprecated. Use 'dump_default' instead.
stage = fields.Str(default="Development")

.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/core/fields.py:435
.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/core/fields.py:435
/tmp/.venv/lib/python3.12/site-packages/azure/ai/ml/_schema/core/fields.py:435: RemovedInMarshmallow4Warning: Passing field metadata as keyword arguments is deprecated. Use the explicit `metadata=...` argument instead. Additional metadata: {'unknown': 'include'}
super().__init__(**kwargs)

...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.