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

[WIP] feat(sdk): block using v2 @component decorator in v1 mode. Fixes #5967 #5989

Closed
wants to merge 11 commits into from
7 changes: 7 additions & 0 deletions sdk/python/kfp/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,13 @@ def _create_dag_templates(self, pipeline, op_transformers=None, op_to_templates_
pipeline_name=self._pipeline_name_param,
pipeline_root=self._pipeline_root_param,
launcher_image=self._launcher_image)

if op.command is not None and\
len(op.command) > 3 and\
"Executor executes v2-based Python function components." in op.command[3] and\
not self._mode == dsl.PipelineExecutionMode.V2_COMPATIBLE:
raise Exception('@component is not allowed in V1 mode')

templates.extend(op_to_templates_handler(op))

if hasattr(op, 'custom_job_spec'):
Expand Down