-
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
Add python conf to the metadata #894
Merged
Merged
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
592ca36
add core types and type checking function
gaoning777 3a3fc17
fix unit test bug
gaoning777 db45632
avoid defining dynamic classes
gaoning777 dcc3baf
typo fix
gaoning777 89c0907
add component metadata format
gaoning777 e55515e
add a construct for the component decorator
gaoning777 eed41fa
add default values for the meta classes
gaoning777 d74d4d8
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 18d5459
add input/output types to the metadata
gaoning777 9218ffe
add from_dict in TypeMeta
gaoning777 d28d555
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 aac35b1
small fix
gaoning777 5ccc857
add unit tests
gaoning777 3081d47
use python struct for the openapi schema
gaoning777 dcf2ecc
Merge branch 'add-core-types-and-checking' into add-component-metadata
gaoning777 a2c89de
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 b0a7314
add default in parameter
gaoning777 c51ccf7
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 b69b807
add default value
gaoning777 57232e4
remove the str restriction for the param default
gaoning777 eb7462a
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 04b86f2
bug fix
gaoning777 622ad68
add pipelinemeta
gaoning777 8834507
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 ac49e68
add pipeline metadata
gaoning777 e05e5e9
ignore annotation if it is not str/BaseType/dict
gaoning777 10ceb09
update param name in the check_type functions
gaoning777 6084865
Merge branch 'add-core-types-and-checking' into add-component-metadata
gaoning777 987e22f
remove default values for non-primitive types in the function signature
gaoning777 a37084b
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 3d625b3
typo in the comments
gaoning777 dd2601f
Merge branch 'master' into add-component-metadata
gaoning777 03c09d9
Merge branch 'master' into add-component-metadata
gaoning777 9c233b3
move the metadata classes to a separate module
gaoning777 ad66a1a
Merge branch 'master' into add-python-meta
gaoning777 25f6b33
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 8ddfbb2
fix unit test
gaoning777 637b921
add __eq__ to meta classes
gaoning777 40224da
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 2392815
fix unit test
gaoning777 1621f0c
Merge branch 'add-component-metadata' into add-python-meta
gaoning777 8312845
fix bug: duplicate variable of args
gaoning777 7bf701a
move python_component and _component decorator in _component file
gaoning777 094cf77
Merge branch 'master' into add-python-meta
gaoning777 16c2f8f
remove the print
gaoning777 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2018 Google LLC | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
from kfp.dsl._component import component | ||
from kfp.dsl._types import GCSPath, Integer | ||
import unittest | ||
|
||
@component | ||
def componentA(a: {'Schema': {'file_type': 'csv'}}, b: '{"number": {"step": "large"}}' = 12, c: GCSPath(path_type='file', file_type='tsv') = 'gs://hello/world') -> {'model': Integer()}: | ||
return 7 | ||
|
||
class TestPythonComponent(unittest.TestCase): | ||
|
||
def test_component(self): | ||
"""Test component decorator.""" | ||
componentA(1,2,3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
nit: do you need to expose component annotation here?
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 wanted to expose the component decorator when fully tested. WDYT?