-
Notifications
You must be signed in to change notification settings - Fork 18
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
Proposes the use of Python's Dataclasses #12
Conversation
Signed-off-by: verdan <verdan.mahmood@gmail.com>
Signed-off-by: verdan <verdan.mahmood@gmail.com>
currently Amundsen supports python36 and above. Will it force to drop python36 support? |
@feng-tao Yes, it will. I've made it explicit in the technical details and also in the drawbacks. I believe we should aim to support as many python versions as possible, but MUST support at least the last 3 versions. The current Python version is 3.9, so I think it is okay to drop the support of Python3.6. |
Given python36 is still widely used these days while python39 is just introduced, I will be hesitant to just drop python36. I take a quick look at airflow and superset which both still supports py3.6. |
@verdan actually it is backported to py36 (https://github.com/ericvsmith/dataclasses). I think it is fine from the python version pov. |
## Unresolved questions | ||
|
||
- Should we aim for having as less dependencies as possible? That includes the third party packages. | ||
- Do we think of a case where we'll be doing heavy data validations, and if those can not be done with dataclasses? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is ok.
oh, this is nice. I did not know that before. I am still curious however why companies are still using Python3.6, as Python3.7 introduced a number of nice feature that the community was waiting for. but yes, the major share is still Python3.6 as you mentioned. |
Strongly in support of this -- cleaner syntax and typing, and the python3.6 backport works well. Any reason not to push this through and start using? |
@feng-tao do we agree to move this to the |
sgtm |
To quote #12 (comment)
Not really related to this RFC itself, but since the topic is up. We're currently only officially supporting 3.6 and 3.7. Looks like the Databuilder package works for folks with 3.8, but tests need some love + maybe addition to CI. Similarly the 3 services need some work just to be able to build with 3.8. Time to kick off that work? I'd be happy to do some of it. I guess it doesn't need a RFC as it's basically just a maintenance chore, not introducing any new feature or breaking anything. |
- One of the main thing to consider is the Python 3.6 support. If we go for the dataclasses, we will not be supporting | ||
Python 3.6 anymore. The minimum version requirement for Python for Amundsen will become 3.7. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- One of the main thing to consider is the Python 3.6 support. If we go for the dataclasses, we will not be supporting | |
Python 3.6 anymore. The minimum version requirement for Python for Amundsen will become 3.7. |
@jornh that would be awesome if you could please help out with making sure that all the services work with the latest 3 versions of Python. In the meantime, I am taking care of the dataclasses. |
Note that dataclasses were landed in the front-end repo, with the back-compat library for 3.6, and is working smoothly. |
Co-authored-by: jornh <jornhansen@gmail.com> Signed-off-by: Dorian Johnson <2020@dorianj.net>
8ecc7fc
to
6027455
Compare
* Proposes the use of Python's Dataclasses Signed-off-by: verdan <verdan.mahmood@gmail.com> * Updates the PR number Signed-off-by: verdan <verdan.mahmood@gmail.com> * Update rfcs/000-python-dataclasses.md Co-authored-by: jornh <jornhansen@gmail.com> Signed-off-by: Dorian Johnson <2020@dorianj.net> Co-authored-by: Tao Feng <tao.feng@databricks.com> Co-authored-by: jornh <jornhansen@gmail.com> Signed-off-by: Allison Suarez Miranda <asuarezmiranda@lyft.com>
Signed-off-by: verdan verdan.mahmood@gmail.com
Python 3.7 introduced dataclasses (PEP557). Dataclasses can be a convenient way to generate classes whose primary goal is to contain values.
We are relying on
attrs
for (de-)serializing data for each request within Amundsen.attrs
itself is a big package with so many different features available that we don't even need.By using Python's native dataclasses we can have one less dependency with almost the same features
attrs
provide that we intend to use.