-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
chore(sdk): remove python 3.6 dead code #7440
Conversation
Skipping CI for Draft Pull Request. |
/test all |
/retest |
/test all |
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.
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 |
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 don't think we need to change this. Our default image for lightweight component is still Python: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.
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 |
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 forget the context on this TODO. Doesn't Dict
guarantee order already?
Do check with @ji-yaqi though.
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.
Good catch, @chensun. I think you're right... explanation:
Dicts are officially ordered in >= Python 3.7. This is a nuanced change: Python dict
s are ordered, but are not OrderedDict
s. 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
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.
Updated: I reverted from Dict
to OrderedDict
in b72d22f.
Please let me know if this is not desired.
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.
OrderedDict SGTM, thank you!
sdk/python/kfp/compiler_cli_tests/test_data/pipeline_with_task_final_status_yaml.json
Outdated
Show resolved
Hide resolved
53413dd
to
f8be5fd
Compare
f8be5fd
to
2838a96
Compare
/test kubeflow-pipelines-samples-v2 |
/lgtm Thanks! |
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.
/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 |
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.
OrderedDict SGTM, thank you!
[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 |
* 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
This is a follow-up PR addressing a comment from @chensun on #7428.
Description of changes
Checklist: