Repository: getindata/kedro-kubeflow
Pull request #112 (2022-03-07 14:04:51)

Release 0.6.1
Bump version and CHANGELOG for next release.


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 04d4f6f..d6cada3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,10 @@
 
 ## [Unreleased]
 
+## [0.6.1] - 2022-03-07
+
+-   Fixed support for parameters of type `datetime.date`
+
 ## [0.6.0] - 2022-02-18
 
 -   Kedro pipeline name is now added into Kubeflow pipeline name during upload
@@ -119,7 +123,9 @@
 -   Method to schedule runs for most recent version of given pipeline `kedro kubeflow schedule` 
 -   Shortcut to open UI for pipelines using `kedro kubeflow ui` 
 
-[Unreleased]: https://github.com/getindata/kedro-kubeflow/compare/0.6.0...HEAD
+[Unreleased]: https://github.com/getindata/kedro-kubeflow/compare/0.6.1...HEAD
+
+[0.6.1]: https://github.com/getindata/kedro-kubeflow/compare/0.6.0...0.6.1
 
 [0.6.0]: https://github.com/getindata/kedro-kubeflow/compare/0.5.1...0.6.0
 
diff --git a/kedro_kubeflow/__init__.py b/kedro_kubeflow/__init__.py
index 7f354cd..3531930 100644
--- a/kedro_kubeflow/__init__.py
+++ b/kedro_kubeflow/__init__.py
@@ -1,3 +1,3 @@
 """kedro_kubeflow."""
 
-version = "0.6.0"
+version = "0.6.1"
diff --git a/kedro_kubeflow/generators/utils.py b/kedro_kubeflow/generators/utils.py
index 54b1e7f..07c207f 100644
--- a/kedro_kubeflow/generators/utils.py
+++ b/kedro_kubeflow/generators/utils.py
@@ -1,5 +1,6 @@
 import contextlib
 import itertools
+import json
 import os
 from functools import wraps
 from inspect import Parameter, signature
@@ -11,6 +12,10 @@ from kfp.compiler._k8s_helper import sanitize_k8s_name
 from ..auth import IAP_CLIENT_ID
 
 
+def ensure_json_serializable(value):
+    return json.loads(json.dumps(value, default=str))
+
+
 def maybe_add_params(kedro_parameters):
     def decorator(f):
         @wraps(f)
@@ -19,7 +24,11 @@ def maybe_add_params(kedro_parameters):
 
         sig = signature(f)
         new_params = (
-            Parameter(name, Parameter.KEYWORD_ONLY, default=default)
+            Parameter(
+                name,
+                Parameter.KEYWORD_ONLY,
+                default=ensure_json_serializable(default),
+            )
             for name, default in kedro_parameters.items()
         )
         wrapper.__signature__ = sig.replace(parameters=new_params)
diff --git a/setup.cfg b/setup.cfg
index 83d39bd..9cf7baf 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.6.0
+current_version = 0.6.1
 
 [bumpversion:file:setup.py]
 
diff --git a/setup.py b/setup.py
index 8175a97..1fbf7fc 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ EXTRA_REQUIRE = {
     "docs": [
         "sphinx==3.4.2",
         "recommonmark==0.7.1",
-        "sphinx_rtd_theme==0.6.0",
+        "sphinx_rtd_theme==0.6.1",
     ],
     "vertexai": [
         "google-cloud-scheduler>=2.3.2",
@@ -37,7 +37,7 @@ EXTRA_REQUIRE = {
 
 setup(
     name="kedro-kubeflow",
-    version="0.6.0",
+    version="0.6.1",
     description="Kedro plugin with Kubeflow support",
     long_description=README,
     long_description_content_type="text/markdown",


Test patch:
diff --git a/tests/test_one_pod_pipeline_generator.py b/tests/test_one_pod_pipeline_generator.py
index 8e5d456..e5b7892 100644
--- a/tests/test_one_pod_pipeline_generator.py
+++ b/tests/test_one_pod_pipeline_generator.py
@@ -1,5 +1,6 @@
 """Test generator"""
 
+import datetime
 import os
 import unittest
 from inspect import signature
@@ -38,7 +39,13 @@ class TestGenerator(unittest.TestCase):
 
     def test_should_support_params_and_inject_them_to_the_node(self):
         # given
-        self.create_generator(params={"param1": 0.3, "param2": 42})
+        self.create_generator(
+            params={
+                "param1": 0.3,
+                "param2": 42,
+                "param3": datetime.date(2022, 2, 24),
+            }
+        )
 
         # when
         with kfp.dsl.Pipeline(None) as dsl_pipeline:
@@ -49,14 +56,17 @@ class TestGenerator(unittest.TestCase):
             pipeline()
 
         # then
-        assert len(default_params) == 2
+        assert len(default_params) == 3
         assert default_params["param1"].default == 0.3
         assert default_params["param2"].default == 42
+        assert default_params["param3"].default == "2022-02-24"
         assert dsl_pipeline.ops["pipeline"].container.args[1:] == [
             "param1",
             "{{pipelineparam:op=;name=param1}}",
             "param2",
             "{{pipelineparam:op=;name=param2}}",
+            "param3",
+            "{{pipelineparam:op=;name=param3}}",
         ]
 
     def test_should_not_add_resources_spec_if_not_requested(self):