Skip to content

Commit

Permalink
chore(sdk): remove kfp.deprecated and legacy samples and tests
Browse files Browse the repository at this point in the history
Signed-off-by: Chen Sun <[email protected]>
  • Loading branch information
chensun committed Nov 8, 2024
1 parent 1708ce7 commit 96bac98
Show file tree
Hide file tree
Showing 359 changed files with 223 additions and 43,214 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ bazel-*
# VSCode
.vscode

# test yaml
sdk/python/tests/compiler/pipeline.yaml
sdk/python/tests/compiler/testdata/testpackage/pipeline.yaml

# Test temporary files
_artifacts

Expand Down
1 change: 0 additions & 1 deletion pytest.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
[pytest]
addopts = --ignore=sdk/python/kfp/deprecated --ignore=sdk/python/kfp/tests
testpaths = sdk/python/kfp

This file was deleted.

10 changes: 4 additions & 6 deletions samples/core/XGBoost/xgboost_sample_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import kfp as kfp
from kfp.samples.test.utils import run_pipeline_func
from kfp.samples.test.utils import TestCase

from .xgboost_sample import xgboost_pipeline
from kfp.samples.test.utils import run_pipeline_func, TestCase

run_pipeline_func([
TestCase(
pipeline_func=xgboost_pipeline,
mode=kfp.dsl.PipelineExecutionMode.V2_ENGINE,
),
TestCase(pipeline_func=xgboost_pipeline),
])
6 changes: 3 additions & 3 deletions samples/core/caching/caching_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import kfp as kfp
from kfp.samples.test.utils import TestCase, relative_path, run_pipeline_func
from kfp.samples.test.utils import relative_path
from kfp.samples.test.utils import run_pipeline_func
from kfp.samples.test.utils import TestCase

run_pipeline_func([
TestCase(
pipeline_file=relative_path(__file__, 'caching.ipynb'),
mode=kfp.dsl.PipelineExecutionMode.V2_ENGINE,
run_pipeline=False,
),
])
51 changes: 0 additions & 51 deletions samples/core/condition/condition.py

This file was deleted.

22 changes: 7 additions & 15 deletions samples/core/condition/condition_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
from __future__ import annotations

import unittest
import kfp.deprecated as kfp

import kfp
from kfp.samples.test.utils import debug_verify
from kfp.samples.test.utils import KfpTask
from kfp.samples.test.utils import run_pipeline_func
from kfp.samples.test.utils import TestCase
import kfp_server_api
from ml_metadata.proto import Execution
from .condition import condition

from .condition_v2 import condition as condition_v2
from kfp.samples.test.utils import KfpTask, debug_verify, run_pipeline_func, TestCase


def verify_heads(t: unittest.TestCase, run: kfp_server_api.ApiRun,
Expand All @@ -43,24 +47,12 @@ def verify_tails(t: unittest.TestCase, run: kfp_server_api.ApiRun,
run_pipeline_func([
TestCase(
pipeline_func=condition_v2,
mode=kfp.dsl.PipelineExecutionMode.V2_ENGINE,
arguments={"force_flip_result": "heads"},
verify_func=verify_heads,
),
TestCase(
pipeline_func=condition_v2,
mode=kfp.dsl.PipelineExecutionMode.V2_ENGINE,
arguments={"force_flip_result": "tails"},
verify_func=verify_tails,
),
TestCase(
pipeline_func=condition,
mode=kfp.dsl.PipelineExecutionMode.V1_LEGACY,
arguments={"force_flip_result": "heads"},
),
TestCase(
pipeline_func=condition,
mode=kfp.dsl.PipelineExecutionMode.V1_LEGACY,
arguments={"force_flip_result": "tails"},
),
])
10 changes: 4 additions & 6 deletions samples/core/condition/nested_condition_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import kfp as kfp
from kfp.samples.test.utils import run_pipeline_func
from kfp.samples.test.utils import TestCase

from .nested_condition import my_pipeline
from kfp.samples.test.utils import run_pipeline_func, TestCase

run_pipeline_func([
TestCase(
pipeline_func=my_pipeline,
mode=kfp.dsl.PipelineExecutionMode.V2_ENGINE,
),
TestCase(pipeline_func=my_pipeline),
])
Loading

0 comments on commit 96bac98

Please sign in to comment.