-
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
Changes from 5 commits
c86ddf7
e7ccf28
567e067
cbbf5d8
7526829
6e8e1ad
2838a96
b72d22f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
import dataclasses | ||
import itertools | ||
import json | ||
from typing import Any, Dict, Mapping, Optional, Sequence, Union | ||
from typing import Any, Dict, Mapping, Optional, OrderedDict, Sequence, Union | ||
|
||
import pydantic | ||
import yaml | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. I forget the context on this TODO. Doesn't There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 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 commentThe reason will be displayed to describe this comment to others. Learn more. Updated: I reverted from Please let me know if this is not desired. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OrderedDict SGTM, thank you! |
||
name: str | ||
description: Optional[str] = None | ||
inputs: Optional[Dict[str, InputSpec]] = None | ||
outputs: Optional[Dict[str, OutputSpec]] = None | ||
inputs: Optional[OrderedDict[str, InputSpec]] = None | ||
outputs: Optional[OrderedDict[str, OutputSpec]] = None | ||
implementation: Implementation | ||
|
||
@pydantic.validator('inputs', 'outputs', allow_reuse=True) | ||
|
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.