Repository: kubeflow/pipelines

Issue:
[sdk] Getting None as value when float 0 is passed in
When the input for a component is of type float and the value passed in is 0 the component gets it as None. Is this expected? If so what all are the scenarios that this would happen in. Following is a sample pipeline that I used on Google Vertex AI. 

### Environment

*  KFP version: 1.8.2
*  All dependencies version:

kfp                      1.8.2
kfp-pipeline-spec        0.1.11
kfp-server-api           1.4.1


### Steps to reproduce

```
from kfp.v2 import dsl

@dsl.component
def test_func(
    a: float, b: float, c: float = 0.0
) -> NamedTuple("ExampleOutputs", [("sum", float), ("product", float)]):
    """Example function that demonstrates how to return multiple values."""
    print(f"a: {a}")
    print(f"b: {b}")
    print(f"c: {c}")

@dsl.pipeline(
    name="test-kfp-v2",
    description="Test kfp v2 pipeline",
    pipeline_root="",
)
def pipeline(
    a: float = 0.0,
):
   test_func(a, 0.0)
```
Actual

a: None
b: None
c: None

Expected

a: 0
b: 0
c: 0


### Materials and Reference

<!-- Help us debug this issue by providing resources such as: sample code, background context, or links to references. -->

---

<!-- Don't delete message below to encourage users to support your issue! -->
Impacted by this bug? Give it a 👍. We prioritise the issues with the most 👍.



Discussion:

Resolving patch:
diff --git a/sdk/python/kfp/v2/components/executor.py b/sdk/python/kfp/v2/components/executor.py
--- a/sdk/python/kfp/v2/components/executor.py
+++ b/sdk/python/kfp/v2/components/executor.py
@@ -79,9 +79,9 @@ def _get_input_parameter_value(self, parameter_name: str,
                 return json.loads(parameter['stringValue'].lower())
             else:
                 return json.loads(parameter['stringValue'])
-        elif parameter.get('intValue'):
+        elif parameter.get('intValue') is not None:
             return int(parameter['intValue'])
-        elif parameter.get('doubleValue'):
+        elif parameter.get('doubleValue') is not None:
             return float(parameter['doubleValue'])
 
     def _get_output_parameter_path(self, parameter_name: str):
@@ -189,7 +189,8 @@ def _is_named_tuple(cls, annotation: Any) -> bool:
     def _handle_single_return_value(self, output_name: str,
                                     annotation_type: Any, return_value: Any):
         if self._is_parameter(annotation_type):
-            origin_type = getattr(annotation_type, '__origin__', None) or annotation_type
+            origin_type = getattr(annotation_type, '__origin__',
+                                  None) or annotation_type
             if not isinstance(return_value, origin_type):
                 raise ValueError(
                     'Function `{}` returned value of type {}; want type {}'


Test patch:
diff --git a/sdk/python/kfp/v2/components/executor_test.py b/sdk/python/kfp/v2/components/executor_test.py
--- a/sdk/python/kfp/v2/components/executor_test.py
+++ b/sdk/python/kfp/v2/components/executor_test.py
@@ -298,6 +298,45 @@ def test_func(first: int, second: int) -> int:
             },
         })
 
+    def test_function_with_float_output(self):
+        executor_input = """\
+    {
+      "inputs": {
+        "parameters": {
+          "first": {
+            "doubleValue": 0.0
+          },
+          "second": {
+            "doubleValue": 1.2
+          }
+        }
+      },
+      "outputs": {
+        "parameters": {
+          "output": {
+            "outputFile": "gs://some-bucket/output"
+          }
+        },
+        "outputFile": "%s/output_metadata.json"
+      }
+    }
+    """
+
+        def test_func(first: float, second: float) -> float:
+            return first + second
+
+        self._get_executor(test_func, executor_input).execute()
+        with open(os.path.join(self._test_dir, 'output_metadata.json'),
+                  'r') as f:
+            output_metadata = json.loads(f.read())
+        self.assertDictEqual(output_metadata, {
+            "parameters": {
+                "Output": {
+                    "doubleValue": 1.2
+                }
+            },
+        })
+
     def test_function_with_list_output(self):
         executor_input = """\
     {