Skip to content

Commit

Permalink
chore(sdk): remove kfp.deprecated from sdk, legacy samples, and legac…
Browse files Browse the repository at this point in the history
…y tests (#11366)

* chore(sdk): remove kfp.deprecated and legacy samples and tests

Signed-off-by: Chen Sun <[email protected]>

* chore: clean up unused imports

Signed-off-by: Chen Sun <[email protected]>

---------

Signed-off-by: Chen Sun <[email protected]>
  • Loading branch information
chensun authored Nov 12, 2024
1 parent 48a1340 commit 11a8b86
Show file tree
Hide file tree
Showing 359 changed files with 196 additions and 43,361 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.

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

import unittest
import kfp.deprecated as kfp

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 +45,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 11a8b86

Please sign in to comment.