-
Notifications
You must be signed in to change notification settings - Fork 42
Test subcategory support(DO NOT MERGE) #97
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
Draft
VaniHaripriya
wants to merge
3
commits into
kubeflow:main
Choose a base branch
from
VaniHaripriya:test-subcategory-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
| # Training Components | ||
|
|
||
| This directory contains components in the **Training** category: | ||
|
|
||
| ## Subcategories | ||
|
|
||
| - [Sklearn Models](./sklearn_models/README.md) |
This file contains hidden or 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,7 @@ | ||
| approvers: | ||
| # TODO: Add your GitHub username here (must be a Kubeflow community member) | ||
| # - your-github-username | ||
| reviewers: | ||
| # TODO: Add reviewers' GitHub usernames here | ||
| # - reviewer1 | ||
| # - reviewer2 |
This file contains hidden or 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,5 @@ | ||
| # Sklearn Models | ||
|
|
||
| This subcategory contains components in the **Sklearn Models** group: | ||
|
|
||
| - [Logistic Regression](./logistic_regression/README.md): Logistic Regression component. |
This file contains hidden or 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 @@ | ||
| """Assets in the sklearn_models subcategory.""" |
7 changes: 7 additions & 0 deletions
7
components/training/sklearn_models/logistic_regression/OWNERS
This file contains hidden or 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,7 @@ | ||
| approvers: | ||
| # TODO: Add your GitHub username here (must be a Kubeflow community member) | ||
| # - your-github-username | ||
| reviewers: | ||
| # TODO: Add reviewers' GitHub usernames here | ||
| # - reviewer1 | ||
| # - reviewer2 |
39 changes: 39 additions & 0 deletions
39
components/training/sklearn_models/logistic_regression/README.md
This file contains hidden or 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,39 @@ | ||
| # Logistic Regression ✨ | ||
|
|
||
| > ⚠️ **Stability: alpha** — This asset is not yet stable and may change. | ||
|
|
||
| ## Overview 🧾 | ||
|
|
||
| Logistic Regression component. | ||
|
|
||
| TODO: Add a detailed description of what this component does. | ||
|
|
||
| Args: input_param: Description of the component parameter. # Add descriptions for other parameters | ||
|
|
||
| Returns: Description of what the component returns. | ||
|
|
||
| ## Inputs 📥 | ||
|
|
||
| | Parameter | Type | Default | Description | | ||
| |-----------|------|---------|-------------| | ||
| | `input_param` | `str` | `None` | | | ||
|
|
||
| ## Outputs 📤 | ||
|
|
||
| | Name | Type | Description | | ||
| |------|------|-------------| | ||
| | Output | `str` | | | ||
|
|
||
| ## Metadata 🗂️ | ||
|
|
||
| - **Name**: logistic_regression | ||
| - **Stability**: alpha | ||
| - **Dependencies**: | ||
| - Kubeflow: | ||
| - Name: Pipelines, Version: >=2.15.2 | ||
| - **Tags**: | ||
| - training | ||
| - **Last Verified**: 2026-02-11 20:18:36+00:00 | ||
| - **Owners**: | ||
| - Approvers: None | ||
| - Reviewers: None |
3 changes: 3 additions & 0 deletions
3
components/training/sklearn_models/logistic_regression/__init__.py
This file contains hidden or 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,3 @@ | ||
| from .component import logistic_regression | ||
|
|
||
| __all__ = ["logistic_regression"] |
34 changes: 34 additions & 0 deletions
34
components/training/sklearn_models/logistic_regression/component.py
This file contains hidden or 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,34 @@ | ||
| from kfp import dsl | ||
|
|
||
|
|
||
| @dsl.component( | ||
| base_image="python:3.11", | ||
| # packages_to_install=["numpy", "pandas"], # Add your dependencies here | ||
| ) | ||
| def logistic_regression( | ||
| # Add your component parameters here | ||
| input_param: str, | ||
| # Add your output artifacts here | ||
| # output_artifact: dsl.Output[dsl.Artifact] | ||
| ) -> str: # Specify your return type | ||
| """Logistic Regression component. | ||
|
|
||
| TODO: Add a detailed description of what this component does. | ||
|
|
||
| Args: | ||
| input_param: Description of the component parameter. | ||
| # Add descriptions for other parameters | ||
|
|
||
| Returns: | ||
| Description of what the component returns. | ||
| """ | ||
| # TODO: Implement your component logic here | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| from kfp.compiler import Compiler | ||
|
|
||
| Compiler().compile( | ||
| logistic_regression, | ||
| package_path=__file__.replace(".py", "_component.yaml"), | ||
| ) |
17 changes: 17 additions & 0 deletions
17
components/training/sklearn_models/logistic_regression/metadata.yaml
This file contains hidden or 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,17 @@ | ||
| --- | ||
| name: logistic_regression | ||
| stability: alpha # New component without proven track record | ||
| dependencies: | ||
| kubeflow: | ||
| - name: Pipelines | ||
| version: '>=2.15.2' | ||
| # external_services: # Add if component uses external services | ||
| # - name: Example Service | ||
| # version: ">=1.0.0" | ||
| tags: | ||
| - training | ||
| # Add more relevant tags here | ||
| lastVerified: 2026-02-11T20:18:36Z | ||
| # links: # Add relevant links | ||
| # documentation: https://your-docs-url.com | ||
| # issue_tracker: https://github.com/kubeflow/pipelines-components/issues | ||
1 change: 1 addition & 0 deletions
1
components/training/sklearn_models/logistic_regression/tests/__init__.py
This file contains hidden or 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 @@ | ||
| # Test package for component tests |
17 changes: 17 additions & 0 deletions
17
components/training/sklearn_models/logistic_regression/tests/test_component_local.py
This file contains hidden or 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,17 @@ | ||
| """Local runner tests for the logistic_regression component.""" | ||
|
|
||
| from ..component import logistic_regression | ||
|
|
||
|
|
||
| class TestLogisticRegressionLocalRunner: | ||
| """Test component with LocalRunner (subprocess execution).""" | ||
|
|
||
| def test_local_execution(self, setup_and_teardown_subprocess_runner): # noqa: F811 | ||
| """Test component execution with LocalRunner.""" | ||
| # TODO: Implement local runner tests for your component | ||
|
|
||
| # Example test structure: | ||
| result = logistic_regression(input_param="test_value") | ||
|
|
||
| # Add assertions about expected outputs if needed | ||
| assert result is not None |
27 changes: 27 additions & 0 deletions
27
components/training/sklearn_models/logistic_regression/tests/test_component_unit.py
This file contains hidden or 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,27 @@ | ||
| """Tests for the logistic_regression component.""" | ||
|
|
||
| from ..component import logistic_regression | ||
|
|
||
|
|
||
| class TestLogisticRegressionUnitTests: | ||
| """Unit tests for component logic.""" | ||
|
|
||
| def test_component_function_exists(self): | ||
| """Test that the component function is properly imported.""" | ||
| assert callable(logistic_regression) | ||
| assert hasattr(logistic_regression, "python_func") | ||
|
|
||
| def test_component_with_default_parameters(self): | ||
| """Test component with valid input parameters.""" | ||
| # TODO: Implement unit tests for your component | ||
|
|
||
| # Example test structure: | ||
| result = logistic_regression.python_func(input_param="test_value") | ||
| assert isinstance(result, str) | ||
| assert "test_value" in result | ||
|
|
||
| # TODO: Add more comprehensive unit tests | ||
| # @mock.patch("external_library.some_function") | ||
| # def test_component_with_mocked_dependencies(self, mock_function): | ||
| # """Test component behavior with mocked external calls.""" | ||
| # pass |
This file contains hidden or 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 @@ | ||
| """Shared utilities for the sklearn_models subcategory.""" |
4 changes: 4 additions & 0 deletions
4
components/training/sklearn_models/shared/sklearn_models_utils.py
This file contains hidden or 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,4 @@ | ||
| """Shared utility functions for the sklearn_models subcategory.""" | ||
|
|
||
|
|
||
| # TODO: Add shared utility functions, classes, or constants here. |
Oops, something went wrong.
Oops, something went wrong.
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.
exit code 2 doesn't seem right 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.
Updated the exit codes in the main PR -#94