DiamondLightSource / DiamondLightSource/python-workflows

Marsmallow 3.24.0 deprecates construction of Field

未关闭
#188 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
9
派生
8
PR 合并指标
30 天内没有已合并 PR

描述

While running system tests for mx-bluesky, I encountered the following warning while loading the zocalo configuration, which we have had to add an explicit ignore for:

```

File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/usr/local/lib/python3.11/site-packages/workflows/util/zocalo/configuration.py", line 33, in
class Pika:
File "/usr/local/lib/python3.11/site-packages/workflows/util/zocalo/configuration.py", line 36, in Pika
class Schema(PluginSchema):
File "/usr/local/lib/python3.11/site-packages/workflows/util/zocalo/configuration.py", line 38, in Schema
port = fields.Field(required=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/marshmallow/fields.py", line 165, in __init__
warnings.warn(
marshmallow.warnings.ChangedInMarshmallow4Warning: `Field` should not be instantiated. Use `fields.Raw` or another field subclass instead.

```

It seems that in 3.24.0 of marshamallow, they have deprecated this usage and are now generating warnings for it.

贡献指南

这个仓库没有索引到贡献指南

调研方向

Start at workflows/util/zocalo/configuration.py, specifically Pika.Schema.port, where fields.Field(required=True) emits the Marshmallow warning. Check the surrounding schema and system-test setup, then verify that loading the zocalo configuration no longer requires the explicit warning ignore under Marshmallow 3.24.0.

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
backend
Issue 类型
缺陷
难度
2/5
预计耗时
1-3 小时
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。