flyteorg / flyte

Scalable and flexible workflow orchestration platform that seamlessly unifies data, ML and analytics stacks.
https://flyte.org
Apache License 2.0
5.17k stars 550 forks source link

[Housekeeping] Remove the need of kwtypes in user code #5500

Open thomasjpfan opened 1 week ago

thomasjpfan commented 1 week ago

Describe the issue

Currently, kwtypes is in user code to convert dicts into OrderedDict. I think this creates another abstraction for users. For APIs, that requires a OrderedDict, they can create it themselves based on the user input.

Even for APIs that require a OrderedDict, since Python 3.7 the normal dict is required to keep insertion order, so it implicitly behaves like an OrderedDict. https://mail.python.org/pipermail/python-dev/2017-December/151283.html

What if we do not do this?

Then users will need to learn about kwtypes and when to use it.

Related component(s)

flytekit

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

Have you read the Code of Conduct?

runllm[bot] commented 1 week ago

The kwtypes function is used to convert keyword arguments into an OrderedDict, which is necessary for certain Flyte APIs. However, since Python 3.7, the standard dict maintains insertion order, making OrderedDict less critical for most use cases (source).

Would you like more detail on how kwtypes is currently used and potential alternatives?

Sources:


This is an AI-generated response and your feedback is appreciated! Please leave a 👍 if this is helpful and 👎 if it is not.

Mention @runllm to ask follow-up questions. See runllm.com for more!