You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Define and execute a pipeline with the following code
slack_notification_op=comp.load_component_from_text(
read_file("components/slack-notification/component.yaml")
)
defget_before_days(date: str, fmt: str, days: int) ->str:
""" Subtract the number of days from the date from the date and the number of days specified in the argument. Parameters ---------- date: str Original Date fmt: str Date formate with a (strftime, strptime) format days: int The number of days to subtract. """fromdatetimeimportdatetime, timedeltadt=datetime.strptime(date, fmt)
new_dt=dt-timedelta(days=days)
returnnew_dt.strftime(fmt)
@dsl.pipeline(name="test",description="",)deffeature_extract_pipeline(
vertex_pipelines_project_id: str,
dataset_id: str,
pipelines_url: str,
slack_webhook: str,
target_date: str,
):
withdsl.ExitHandler(
exit_op=slack_notification_op(
job_name="{{workflow.name}}",
webhook_url=slack_webhook,
status="{{workflow.status}}",
pipelines_url=f"{pipelines_url}/pipeline/#/runs/details/{{{{workflow.uid}}}}",
)
):
get_before_a_days_op=comp.create_component_from_func(
func=get_before_days, base_image="python:alpine"
)
before_a_day=get_before_a_days_op(
target_date, "%Y%m%d", 1
)
fromkfp.v2importcompilerimporttempfilewithtempfile.TemporaryDirectory() astempdir:
package_path=os.path.join(tempdir, "pipeline.json")
# NOTE: The type_check argument is probably not working.compiler.Compiler().compile(pipeline_func=feature_extract_pipeline, package_path=package_path)
following is error messsage
ata/.pyenv/versions/3.7.1rc1/lib/python3.7/site-packages/kfp/v2/compiler/compiler.py", line 687, in _group_to_dag_spec
input_artifacts_in_current_dag,
File "/Users/takuya.hirata/.pyenv/versions/3.7.1rc1/lib/python3.7/site-packages/kfp/dsl/component_spec.py", line 338, in update_task_inputs_spec
component_input_parameter, parent_component_inputs)
AssertionError: component_input_parameter: pipelineparam--pipelineparam--target_date not found. All inputs:
I got same error occurred when using from kfp.v2.dsl import component. If you use a python function with component, you will get an error like the one above
Expected result
No errors occur during compilation.
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered:
I noticed that I can compile without using the exit handler.
I just did a print debugging.
The target_date is recognized as a input_parameter of the subgroup component, but there is no such parameter in the parent, which may be causing the above error.
Environment
1.6.3
Steps to reproduce
Define and execute a pipeline with the following code
following is error messsage
I got same error occurred when using
from kfp.v2.dsl import component
.If you use a python function with component, you will get an error like the one aboveExpected result
No errors occur during compilation.
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.
The text was updated successfully, but these errors were encountered: