flask-muck icon indicating copy to clipboard operation
flask-muck copied to clipboard

TypeError: Field.__init__() got an unexpected keyword argument 'missing'

Open BrianBut opened this issue 5 months ago • 3 comments

Recent changes appear introduced this error which appears when a new project or any of the examples: flask-muck/examples/02_pydantic$ python3 app.py Traceback (most recent call last): File "/home/brian/SandboxPydantic/flask-muck/examples/02_pydantic/app.py", line 6, in from flask_muck import FlaskMuckApiView, FlaskMuck File "/home/brian/SandboxPydantic/flask-muck/.venv/lib/python3.11/site-packages/flask_muck/init.py", line 1, in from .views import FlaskMuckApiView File "/home/brian/SandboxPydantic/flask-muck/.venv/lib/python3.11/site-packages/flask_muck/views.py", line 52, in class FlaskMuckApiView(MethodView): File "/home/brian/SandboxPydantic/flask-muck/.venv/lib/python3.11/site-packages/flask_muck/views.py", line 181, in FlaskMuckApiView "limit": fields.Integer(missing=None), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/brian/SandboxPydantic/flask-muck/.venv/lib/python3.11/site-packages/marshmallow/fields.py", line 977, in init super().init(as_string=as_string, **kwargs) File "/home/brian/SandboxPydantic/flask-muck/.venv/lib/python3.11/site-packages/marshmallow/fields.py", line 924, in init super().init(**kwargs) TypeError: Field.init() got an unexpected keyword argument 'missing'

BrianBut avatar Jul 30 '25 05:07 BrianBut

I'll check this out tonight. Some other devs ran into the same pkg_resource dependency problem that plagues this package. I'm going to bring in their fix tonight and that will get the build process working again. Then I'll get this sorted at the same time.

dtiesling avatar Jul 30 '25 15:07 dtiesling

@BrianBut I'm not able to reproduce but I suspect it's a dependency issue.

if you check out the README in the example directories they have a command to run the test server. Try running this using pipenv run python3 app.py and let me know if that resolves it.

dtiesling avatar Jul 30 '25 15:07 dtiesling

I changed marshmallow from 4.0.0 to 3.18.0, and fixed the problem.

musicpop avatar Aug 14 '25 05:08 musicpop