From d2c0f6aa2cad47c9bb63fb7b115d410979c4ee33 Mon Sep 17 00:00:00 2001 From: Yann Forget Date: Mon, 19 May 2025 17:54:00 +0200 Subject: [PATCH 1/2] fix: type of `arg` should be of type `type` --- openhexa/sdk/pipelines/parameter.py | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) diff --git a/openhexa/sdk/pipelines/parameter.py b/openhexa/sdk/pipelines/parameter.py index 8fc32936..817a2b78 100644 --- a/openhexa/sdk/pipelines/parameter.py +++ b/openhexa/sdk/pipelines/parameter.py @@ -387,16 +387,7 @@ def __init__( self, code: str, *, - type: str - | int - | bool - | S3Connection - | CustomConnection - | DHIS2Connection - | IASOConnection - | PostgreSQLConnection - | GCSConnection - | Dataset, + type: type, name: str | None = None, choices: typing.Sequence | None = None, help: str | None = None, @@ -562,17 +553,7 @@ def validate_parameters(parameters: list[Parameter]): def parameter( code: str, *, - type: str - | int - | bool - | float - | DHIS2Connection - | IASOConnection - | PostgreSQLConnection - | GCSConnection - | S3Connection - | CustomConnection - | Dataset, + type: type, name: str | None = None, choices: typing.Sequence | None = None, help: str | None = None, From b271c874b7c6ee26cc978bb80dd5ac67a0ca7c1e Mon Sep 17 00:00:00 2001 From: Yann Forget Date: Tue, 20 May 2025 09:20:06 +0200 Subject: [PATCH 2/2] fix: filter valid types --- openhexa/sdk/pipelines/parameter.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/openhexa/sdk/pipelines/parameter.py b/openhexa/sdk/pipelines/parameter.py index 817a2b78..409f8e57 100644 --- a/openhexa/sdk/pipelines/parameter.py +++ b/openhexa/sdk/pipelines/parameter.py @@ -387,7 +387,19 @@ def __init__( self, code: str, *, - type: type, + type: type[ + str + | int + | bool + | float + | DHIS2Connection + | IASOConnection + | PostgreSQLConnection + | GCSConnection + | S3Connection + | CustomConnection + | Dataset + ], name: str | None = None, choices: typing.Sequence | None = None, help: str | None = None, @@ -553,7 +565,19 @@ def validate_parameters(parameters: list[Parameter]): def parameter( code: str, *, - type: type, + type: type[ + str + | int + | bool + | float + | DHIS2Connection + | IASOConnection + | PostgreSQLConnection + | GCSConnection + | S3Connection + | CustomConnection + | Dataset + ], name: str | None = None, choices: typing.Sequence | None = None, help: str | None = None,