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

chore(sdk): remove python 3.6 dead code #7440

Merged
merged 8 commits into from
Mar 21, 2022

Conversation

connor-mccarthy
Copy link
Member

@connor-mccarthy connor-mccarthy commented Mar 18, 2022

This is a follow-up PR addressing a comment from @chensun on #7428.

Description of changes

  • migrate modules to >= python 3.7
  • update test images to greatest supported python version
  • remove unused import

Checklist:

@google-oss-prow
Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@connor-mccarthy
Copy link
Member Author

/test all

@connor-mccarthy
Copy link
Member Author

/retest

@connor-mccarthy
Copy link
Member Author

/test all

@connor-mccarthy connor-mccarthy marked this pull request as ready for review March 18, 2022 20:28
Copy link
Member

@chensun chensun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title is a bit misleading, as we dropped Python 3.6 support via #7303.
This is more of some dead code cleanup, I think. Maybe reframe the title a bit?

@@ -553,7 +552,7 @@ def test_use_task_final_status_in_non_exit_op_yaml(self):
- {name: message, type: PipelineTaskFinalStatus}
implementation:
container:
image: python:3.7
image: python:3.9
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need to change this. Our default image for lightweight component is still Python:3.7

Copy link
Member Author

@connor-mccarthy connor-mccarthy Mar 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. I misunderstood this template definition as having a functional effect for our tests.

@@ -305,12 +305,10 @@ class ComponentSpec(BaseModel):
implementation: The implementation of the component. Either an executor
(container, importer) or a DAG consists of other components.
"""
# TODO(ji-yaqi): Update to OrderedDict for inputs and outputs once we drop
# Python 3.6 support
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget the context on this TODO. Doesn't Dict guarantee order already?
Do check with @ji-yaqi though.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, @chensun. I think you're right... explanation:

Dicts are officially ordered in >= Python 3.7. This is a nuanced change: Python dicts are ordered, but are not OrderedDicts. We accept dict (e.g., dictionaries without the special OrderedDict methods), so it seems like we should not needlessly narrow this type from the superclass dict to the subclass typing.OrderedDict.

In code:

import typing
import collections

d = {"a": True, "b": False}
od = collections.OrderedDict({"a": True, "b": False})

assert isinstance(od, dict) # type-checking would pass with the looser type
assert not isinstance(d, typing.OrderedDict) # type-checking would fail with the narrower type

@ji-yaqi, do you agree? If so, I will revert.

Further reading: Choosing Between OrderedDict and dict

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated: I reverted from Dict to OrderedDict in b72d22f.

Please let me know if this is not desired.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OrderedDict SGTM, thank you!

@connor-mccarthy connor-mccarthy changed the title chore(sdk): remove python 3.6 support chore(sdk): remove python 3.6 dead code Mar 18, 2022
@connor-mccarthy
Copy link
Member Author

Title is a bit misleading, as we dropped Python 3.6 support via #7303. This is more of some dead code cleanup, I think. Maybe reframe the title a bit?

Thanks @chensun. Updated.

@connor-mccarthy
Copy link
Member Author

/test kubeflow-pipelines-samples-v2

@chensun
Copy link
Member

chensun commented Mar 21, 2022

/lgtm

Thanks!

Copy link
Contributor

@ji-yaqi ji-yaqi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

Thank you!

@@ -305,12 +305,10 @@ class ComponentSpec(BaseModel):
implementation: The implementation of the component. Either an executor
(container, importer) or a DAG consists of other components.
"""
# TODO(ji-yaqi): Update to OrderedDict for inputs and outputs once we drop
# Python 3.6 support
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OrderedDict SGTM, thank you!

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ji-yaqi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow google-oss-prow bot merged commit 41caca8 into kubeflow:master Mar 21, 2022
abaland pushed a commit to abaland/pipelines that referenced this pull request May 29, 2022
* migrate modules to >= python 3.7

* update test images to greatest supported python version

* remove unused import

* update test data

* clean comment

* undo 3.7 image change

* revert 3.9 -> 3.7

* revert OrderedDict to Dict
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants