Im developing a set of kubeflow lightweight components. I know that, if all I want to do is return a bool I can do it this way:
def mockup_data_drifting_comp(output_component_file):
@component(
packages_to_install=.........,
output_component_file=..........
)
def mockup_data_drifting(input_csv: Input[Dataset]) -> bool:
return True
return mockup_data_drifting
But now I want to return an output[Dataset] and a boolean parameter. According to the documentation this should be done like in the example they provide but typing the parameter as a bool and not an str:
def mockup_data_drifting_comp(output_component_file):
@component(
packages_to_install==.........,
output_component_file==.........
)
def mockup_data_drifting(input_csv: Input[Dataset],
prepared_csv: Output[Dataset],
removed_data: OutputPath(bool)):
The thing is I don't know how can I actually return that value. At the end of my code I have:
df.to_csv(prepared_csv.path)
Which works fine and it is passed to the next step in the pipeline. But how can this be done for bool or even int parameters? I have try:
removed_data = False
and
with open(removed_data, 'w') as output_file:
output_file.write(False)
But both of them are not working. I refuse to think that I have to write a str with the text 'False', but its the only thing that already comes to my mind. Thanks in advance!