Skip to content

Commit

Permalink
#minor Revert "Adopt flyteidl's ordered variable map change" #608 (#647)
Browse files Browse the repository at this point in the history
* Revert "Adopt flyteidl's ordered variable map change (#608)"
This reverts commit 204b13f
* Upgrade flyteidl to 0.21.0
Signed-off-by: Sean Lin <[email protected]>
  • Loading branch information
mayitbeegh authored Sep 10, 2021
1 parent 042562a commit d6a8c5d
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 96 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/pythonbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ jobs:
run: |
python -m pip install pip==21.2.4 setuptools==57.4.0 wheel==0.37.0
make setup${{ matrix.spark-version-suffix }}
make -C plugins install-all-dev
pip freeze
- name: Lint
run: |
Expand All @@ -46,7 +45,7 @@ jobs:
boilerplate
- name: Test with coverage
run: |
coverage run -m pytest tests/flytekit/unit tests/scripts plugins/tests
coverage run -m pytest tests/flytekit/unit tests/scripts
- name: Integration Tests with coverage
# https://github.com/actions/runner/issues/241#issuecomment-577360161
shell: 'script -q -e -c "bash {0}"'
Expand Down
12 changes: 6 additions & 6 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ decorator==5.0.9
# via
# -c requirements.txt
# retry
deprecated==1.2.12
deprecated==1.2.13
# via
# -c requirements.txt
# flytekit
Expand All @@ -77,7 +77,7 @@ distlib==0.3.2
# via virtualenv
distro==1.6.0
# via docker-compose
docker[ssh]==5.0.1
docker[ssh]==5.0.2
# via docker-compose
docker-compose==1.29.2
# via
Expand All @@ -97,15 +97,15 @@ docstring-parser==0.10
# flytekit
filelock==3.0.12
# via virtualenv
flyteidl==0.20.1
flyteidl==0.21.0
# via
# -c requirements.txt
# flytekit
grpcio==1.39.0
grpcio==1.40.0
# via
# -c requirements.txt
# flytekit
identify==2.2.13
identify==2.2.14
# via pre-commit
idna==3.2
# via
Expand Down Expand Up @@ -189,7 +189,7 @@ platformdirs==2.3.0
# virtualenv
pluggy==1.0.0
# via pytest
pre-commit==2.14.1
pre-commit==2.15.0
# via -r dev-requirements.in
protobuf==3.17.3
# via
Expand Down
16 changes: 8 additions & 8 deletions doc-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ backcall==0.2.0
# via ipython
bcrypt==3.2.0
# via paramiko
beautifulsoup4==4.9.3
beautifulsoup4==4.10.0
# via
# furo
# sphinx-code-include
Expand All @@ -35,9 +35,9 @@ black==21.8b0
# via papermill
bleach==4.1.0
# via nbconvert
boto3==1.18.32
boto3==1.18.39
# via sagemaker-training
botocore==1.21.32
botocore==1.21.39
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -72,7 +72,7 @@ decorator==5.0.9
# retry
defusedxml==0.7.1
# via nbconvert
deprecated==1.2.12
deprecated==1.2.13
# via flytekit
dirhash==0.2.1
# via flytekit
Expand All @@ -89,15 +89,15 @@ entrypoints==0.3
# jupyter-client
# nbconvert
# papermill
flyteidl==0.20.1
flyteidl==0.21.0
# via flytekit
git+git://github.com/flyteorg/furo@main
# via -r doc-requirements.in
gevent==21.8.0
# via sagemaker-training
greenlet==1.1.1
# via gevent
grpcio==1.39.0
grpcio==1.40.0
# via
# -r doc-requirements.in
# flytekit
Expand Down Expand Up @@ -160,7 +160,7 @@ marshmallow-enum==1.5.1
# via dataclasses-json
marshmallow-jsonschema==0.12.0
# via flytekit
matplotlib-inline==0.1.2
matplotlib-inline==0.1.3
# via ipython
mistune==0.8.4
# via nbconvert
Expand Down Expand Up @@ -397,7 +397,7 @@ typing-extensions==3.10.0.2
# typing-inspect
typing-inspect==0.7.1
# via dataclasses-json
unidecode==1.2.0
unidecode==1.3.1
# via
# python-slugify
# sphinx-autoapi
Expand Down
30 changes: 9 additions & 21 deletions flytekit/models/interface.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing
from collections import OrderedDict

import six as _six
from flyteidl.core import interface_pb2 as _interface_pb2

from flytekit.models import common as _common
Expand Down Expand Up @@ -73,17 +73,15 @@ def to_flyte_idl(self):
"""
:rtype: dict[Text, Variable]
"""
return _interface_pb2.VariableMap(
variables=[_interface_pb2.VariableMapEntry(name=k, var=v.to_flyte_idl()) for k, v in self.variables.items()]
)
return _interface_pb2.VariableMap(variables={k: v.to_flyte_idl() for k, v in _six.iteritems(self.variables)})

@classmethod
def from_flyte_idl(cls, pb2_object):
"""
:param dict[Text, Variable] pb2_object:
:rtype: VariableMap
"""
return cls(OrderedDict((v.name, Variable.from_flyte_idl(v.var)) for v in pb2_object.variables))
return cls({k: Variable.from_flyte_idl(v) for k, v in _six.iteritems(pb2_object.variables)})


class TypedInterface(_common.FlyteIdlEntity):
Expand All @@ -108,15 +106,9 @@ def outputs(self) -> typing.Dict[str, Variable]:

def to_flyte_idl(self) -> _interface_pb2.TypedInterface:
return _interface_pb2.TypedInterface(
inputs=_interface_pb2.VariableMap(
variables=[
_interface_pb2.VariableMapEntry(name=k, var=v.to_flyte_idl()) for k, v in self.inputs.items()
]
),
inputs=_interface_pb2.VariableMap(variables={k: v.to_flyte_idl() for k, v in _six.iteritems(self.inputs)}),
outputs=_interface_pb2.VariableMap(
variables=[
_interface_pb2.VariableMapEntry(name=k, var=v.to_flyte_idl()) for k, v in self.outputs.items()
]
variables={k: v.to_flyte_idl() for k, v in _six.iteritems(self.outputs)}
),
)

Expand All @@ -126,8 +118,8 @@ def from_flyte_idl(cls, proto: _interface_pb2.TypedInterface) -> "TypedInterface
:param proto:
"""
return cls(
inputs=OrderedDict((v.name, Variable.from_flyte_idl(v.var)) for v in proto.inputs.variables),
outputs=OrderedDict((v.name, Variable.from_flyte_idl(v.var)) for v in proto.outputs.variables),
inputs={k: Variable.from_flyte_idl(v) for k, v in _six.iteritems(proto.inputs.variables)},
outputs={k: Variable.from_flyte_idl(v) for k, v in _six.iteritems(proto.outputs.variables)},
)


Expand Down Expand Up @@ -219,9 +211,7 @@ def to_flyte_idl(self):
:rtype: flyteidl.core.interface_pb2.ParameterMap
"""
return _interface_pb2.ParameterMap(
parameters=[
_interface_pb2.ParameterMapEntry(name=k, parameter=v.to_flyte_idl()) for k, v in self.parameters.items()
]
parameters={k: v.to_flyte_idl() for k, v in _six.iteritems(self.parameters)},
)

@classmethod
Expand All @@ -230,6 +220,4 @@ def from_flyte_idl(cls, pb2_object):
:param flyteidl.core.interface_pb2.ParameterMap pb2_object:
:rtype: ParameterMap
"""
return cls(
parameters=OrderedDict((v.name, Parameter.from_flyte_idl(v.parameter)) for v in pb2_object.parameters)
)
return cls(parameters={k: Parameter.from_flyte_idl(v) for k, v in _six.iteritems(pb2_object.parameters)})
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
flytekit>=0.22.0b6
flytekit>=0.20.1
sqlalchemy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with python 3.9
# This file is autogenerated by pip-compile with python 3.8
# To update, run:
#
# pip-compile requirements.in
Expand All @@ -26,15 +26,11 @@ deprecated==1.2.12
# via flytekit
dirhash==0.2.1
# via flytekit
diskcache==5.2.1
# via flytekit
docker-image-py==0.1.10
# via flytekit
docstring-parser==0.10
# via flytekit
flyteidl==0.20.1
flyteidl==0.19.5
# via flytekit
flytekit==0.22.0b6
flytekit==0.20.1
# via -r requirements.in
greenlet==1.1.0
# via sqlalchemy
Expand Down
12 changes: 6 additions & 6 deletions requirements-spark2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ black==21.8b0
# via papermill
bleach==4.1.0
# via nbconvert
boto3==1.18.32
boto3==1.18.39
# via sagemaker-training
botocore==1.21.32
botocore==1.21.39
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -58,7 +58,7 @@ decorator==5.0.9
# retry
defusedxml==0.7.1
# via nbconvert
deprecated==1.2.12
deprecated==1.2.13
# via flytekit
dirhash==0.2.1
# via flytekit
Expand All @@ -73,13 +73,13 @@ entrypoints==0.3
# jupyter-client
# nbconvert
# papermill
flyteidl==0.20.1
flyteidl==0.21.0
# via flytekit
gevent==21.8.0
# via sagemaker-training
greenlet==1.1.1
# via gevent
grpcio==1.39.0
grpcio==1.40.0
# via flytekit
hmsclient==0.1.1
# via flytekit
Expand Down Expand Up @@ -131,7 +131,7 @@ marshmallow-enum==1.5.1
# via dataclasses-json
marshmallow-jsonschema==0.12.0
# via flytekit
matplotlib-inline==0.1.2
matplotlib-inline==0.1.3
# via ipython
mistune==0.8.4
# via nbconvert
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ black==21.8b0
# via papermill
bleach==4.1.0
# via nbconvert
boto3==1.18.32
boto3==1.18.39
# via sagemaker-training
botocore==1.21.32
botocore==1.21.39
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -58,7 +58,7 @@ decorator==5.0.9
# retry
defusedxml==0.7.1
# via nbconvert
deprecated==1.2.12
deprecated==1.2.13
# via flytekit
dirhash==0.2.1
# via flytekit
Expand All @@ -73,13 +73,13 @@ entrypoints==0.3
# jupyter-client
# nbconvert
# papermill
flyteidl==0.20.1
flyteidl==0.21.0
# via flytekit
gevent==21.8.0
# via sagemaker-training
greenlet==1.1.1
# via gevent
grpcio==1.39.0
grpcio==1.40.0
# via flytekit
hmsclient==0.1.1
# via flytekit
Expand Down Expand Up @@ -131,7 +131,7 @@ marshmallow-enum==1.5.1
# via dataclasses-json
marshmallow-jsonschema==0.12.0
# via flytekit
matplotlib-inline==0.1.2
matplotlib-inline==0.1.3
# via ipython
mistune==0.8.4
# via nbconvert
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
]
},
install_requires=[
"flyteidl>=0.20.1,<0.21.0",
"flyteidl>=0.21.0,<0.22.0",
"wheel>=0.30.0,<1.0.0",
"pandas>=1.0.0,<2.0.0",
"pyarrow>=2.0.0,<4.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
flytekit>=0.22.0b6
flytekit>=0.17.0b0
wheel
matplotlib
opencv-python
Loading

0 comments on commit d6a8c5d

Please sign in to comment.