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

Unit test for pipeline in Vertex AI #20

Open
RobertWan91 opened this issue Apr 22, 2022 · 1 comment
Open

Unit test for pipeline in Vertex AI #20

RobertWan91 opened this issue Apr 22, 2022 · 1 comment

Comments

@RobertWan91
Copy link

After reading the notebook: https://github.com/GoogleCloudPlatform/mlops-with-vertex-ai/blob/main/04-pipeline-deployment.ipynb

the unit test is testing the functions which is not used to launch the pipeline. It seems that there are two sets of functions, one for unit test and one for createing pipeline. Is that possible to test the functions defined under @component decorators?

Many thanks,

@glema-xmartlabs
Copy link

glema-xmartlabs commented Nov 14, 2023

To access the function defined under the @component you need to get its python_func attribute.
So if you have a function:

@component
def foo():
  return 'foo'

Then you can test it like this:

def test_foo():
  assert foo.python_func() == 'foo'

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

No branches or pull requests

2 participants