Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] The new release of dataclasses-json broke flytekit stock installations #3873

Closed
2 tasks done
eapolinario opened this issue Jul 18, 2023 · 2 comments · Fixed by flyteorg/flytekit#1746 or flyteorg/flytekit#1754
Closed
2 tasks done
Assignees
Labels
bug Something isn't working flytekit FlyteKit Python related issue

Comments

@eapolinario
Copy link
Contributor

eapolinario commented Jul 18, 2023

Describe the bug

The dataclasses-json package released a new version (0.5.12) which dropped the dependency on marshmallow-enum. Unfortunately, flytekit didn't list marshmallow-enum as a dependency, which ended up breaking stock flytekit installations.

Expected behavior

Stock flytekit installations (i.e. from coming pip install flytekit) should work.

Additional context to reproduce

> pip install flytekit
...
> pyflyte init test-sandbox
Traceback (most recent call last):
  File "/private/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.CpjR9RUs/venv/bin/pyflyte", line 5, in <module>
    from flytekit.clis.sdk_in_container.pyflyte import main
  File "/private/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.CpjR9RUs/venv/lib/python3.8/site-packages/flytekit/__init__.py", line 208, in <module>
    from flytekit.core.base_sql_task import SQLTask
  File "/private/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.CpjR9RUs/venv/lib/python3.8/site-packages/flytekit/core/base_sql_task.py", line 4, in <module>
    from flytekit.core.base_task import PythonTask, TaskMetadata
  File "/private/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.CpjR9RUs/venv/lib/python3.8/site-packages/flytekit/core/base_task.py", line 34, in <module>
    from flytekit.core.interface import Interface, transform_interface_to_typed_interface
  File "/private/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.CpjR9RUs/venv/lib/python3.8/site-packages/flytekit/core/interface.py", line 14, in <module>
    from flytekit.core.type_engine import TypeEngine
  File "/private/var/folders/p4/qvgny9x95p5_vhdc7gxh2hsc0000gn/T/tmp.CpjR9RUs/venv/lib/python3.8/site-packages/flytekit/core/type_engine.py", line 24, in <module>
    from marshmallow_enum import EnumField, LoadDumpOptions
ModuleNotFoundError: No module named 'marshmallow_enum'

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@eapolinario eapolinario added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Jul 18, 2023
@eapolinario eapolinario self-assigned this Jul 18, 2023
@eapolinario eapolinario added flytekit FlyteKit Python related issue and removed untriaged This issues has not yet been looked at by the Maintainers labels Jul 18, 2023
@eapolinario eapolinario linked a pull request Jul 18, 2023 that will close this issue
8 tasks
@eapolinario
Copy link
Contributor Author

The workaround is to pin dataclasses-json<0.5.12.

@fellhorn
Copy link
Contributor

fellhorn commented Mar 20, 2024

As we wanted to update dataclasses-json, I looked at the current state of this issue and got stuck:

lidatong/dataclasses-json#384 switches to native Enum instead of EnumField from marshmallow-enum. marshmallow-jsonschema though still only supports the deprecated marshmallow-enum, which has been archived since October 2022.

There is an open PR to add native Enum support to marshmallow-jsonschema but the maintainer seems to have quasi abandoned the project and there have not been any updates.

I did test the native Enum support from the PR mentioned above and it looks like we could make it work in flytekit. How should we deal with the quasi unmaintained marshmallow-jsonschema though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working flytekit FlyteKit Python related issue
Projects
None yet
2 participants