From d48ae238703746d785f818f3481158bcf690a3bd Mon Sep 17 00:00:00 2001 From: YolanFery Date: Wed, 1 Apr 2026 11:51:51 +0200 Subject: [PATCH 1/5] Revert "chore(deps): update dependency python to 3.14 (#363)" This reverts commit 178b0a763455393be282ca9602db25f6182b6471. --- .github/workflows/schema-compatibility-cron.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/schema-compatibility-cron.yml b/.github/workflows/schema-compatibility-cron.yml index f95ce238..46c9980c 100644 --- a/.github/workflows/schema-compatibility-cron.yml +++ b/.github/workflows/schema-compatibility-cron.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/setup-python@v6 with: - python-version: "3.14" + python-version: "3.13" - run: pip install --upgrade openhexa.sdk From c19a4048d840a849e7df0669ea100417521417e1 Mon Sep 17 00:00:00 2001 From: Yolan Fery Date: Wed, 1 Apr 2026 12:06:09 +0200 Subject: [PATCH 2/5] fix: parameter typing for File (#371) --- openhexa/sdk/pipelines/parameter.py | 6 ++++-- pyproject.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/openhexa/sdk/pipelines/parameter.py b/openhexa/sdk/pipelines/parameter.py index d4faf7e5..175c4b31 100644 --- a/openhexa/sdk/pipelines/parameter.py +++ b/openhexa/sdk/pipelines/parameter.py @@ -445,6 +445,7 @@ def __init__( | S3Connection | CustomConnection | Dataset + | File ], name: str | None = None, choices: typing.Sequence | None = None, @@ -628,6 +629,7 @@ def parameter( | S3Connection | CustomConnection | Dataset + | File ], name: str | None = None, choices: typing.Sequence | None = None, @@ -647,7 +649,7 @@ def parameter( ---------- code : str The parameter identifier (must be unique for a given pipeline) - type : {str, int, bool, float, DHIS2Connection, IASOConnection, PostgreSQLConnection, GCSConnection, S3Connection} + type : {str, int, bool, float, DHIS2Connection, IASOConnection, PostgreSQLConnection, GCSConnection, S3Connection, CustomConnection, Dataset, File} The parameter Python type name : str, optional A name for the parameter (will be used instead of the code in the web interface) @@ -668,7 +670,7 @@ def parameter( Whether this parameter should be provided multiple values (if True, the value must be provided as a list of values of the chosen type) directory : str, optional - An optional parameter to force file selection to specific directory (only used for parater type File). If the directory does not exist, it will be ignored. + An optional parameter to force file selection to specific directory (only used for parameter type File). If the directory does not exist, it will be ignored. Returns ------- diff --git a/pyproject.toml b/pyproject.toml index 2d6e76b4..61374293 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ requires-python = ">=3.11,<3.15" # the main constraint for supported Python vers dependencies = [ "urllib3<3", "multiprocess~=0.70.15", - "requests>=2.31,<2.33", + "requests>=2.31,<2.34", "PyYAML~=6.0", "click~=8.1.3", "jinja2>3,<4", From c5172529586f8dbca9adb36da9705cbf806012ca Mon Sep 17 00:00:00 2001 From: blsqbot <83090543+blsqbot@users.noreply.github.com> Date: Wed, 1 Apr 2026 12:14:59 +0200 Subject: [PATCH 3/5] chore: release v2.19.4 (#370) --- .release-please-manifest.json | 2 +- CHANGELOG.md | 12 ++++++++++++ pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1cbd6b51..8dff6b0e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.19.3" + ".": "2.19.4" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index b5120bcc..7fc9d8e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # Changelog +## [2.19.4](https://github.com/BLSQ/openhexa-sdk-python/compare/v2.19.3...v2.19.4) (2026-04-01) + + +### Bug Fixes + +* parameter typing for File ([#371](https://github.com/BLSQ/openhexa-sdk-python/issues/371)) ([c19a404](https://github.com/BLSQ/openhexa-sdk-python/commit/c19a4048d840a849e7df0669ea100417521417e1)) + + +### Miscellaneous + +* **deps:** update dependency python to 3.14 ([#363](https://github.com/BLSQ/openhexa-sdk-python/issues/363)) ([178b0a7](https://github.com/BLSQ/openhexa-sdk-python/commit/178b0a763455393be282ca9602db25f6182b6471)) + ## [2.19.3](https://github.com/BLSQ/openhexa-sdk-python/compare/v2.19.2...v2.19.3) (2026-03-16) diff --git a/pyproject.toml b/pyproject.toml index 61374293..4f510e5f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "openhexa.sdk" -version = "2.19.3" +version = "2.19.4" description = "OpenHEXA SDK" authors = [{ name = "Bluesquare", email = "dev@bluesquarehub.com" }] From e628b7f04b2b440e5dd9eaeb261fdf5b6016e1bf Mon Sep 17 00:00:00 2001 From: YolanFery Date: Fri, 3 Apr 2026 18:33:52 +0200 Subject: [PATCH 4/5] fix: type --- openhexa/sdk/pipelines/parameter.py | 16 ++++++++-------- openhexa/sdk/pipelines/runtime.py | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/openhexa/sdk/pipelines/parameter.py b/openhexa/sdk/pipelines/parameter.py index 7fb89d68..86d6e831 100644 --- a/openhexa/sdk/pipelines/parameter.py +++ b/openhexa/sdk/pipelines/parameter.py @@ -389,7 +389,7 @@ def validate(self, value: typing.Any | None) -> File: raise ParameterValueError(str(e)) -class Secret: +class Secret(str): """Marker type for secret/password pipeline parameters. Use as the ``type`` argument of the ``@parameter`` decorator to indicate that the parameter value is sensitive @@ -418,7 +418,7 @@ def spec_type(self) -> str: @property def expected_type(self) -> type: """Returns the python type expected for values.""" - return str + return Secret @property def accepts_choices(self) -> bool: @@ -431,8 +431,8 @@ def accepts_multiple(self) -> bool: return False @staticmethod - def normalize(value: typing.Any) -> str | None: - """Strip whitespace and convert empty strings to None.""" + def normalize(value: typing.Any) -> Secret | None: + """Strip whitespace, convert empty strings to None, and wrap as Secret.""" if isinstance(value, str): normalized_value = value.strip() else: @@ -441,6 +441,9 @@ def normalize(value: typing.Any) -> str | None: if normalized_value == "": return None + if isinstance(normalized_value, str): + return Secret(normalized_value) + return normalized_value def validate_default(self, value: typing.Any | None): @@ -524,10 +527,7 @@ def __init__( self.code = code try: - if isinstance(type, ParameterType): - self.type = type - else: - self.type = TYPES_BY_PYTHON_TYPE[type.__name__]() + self.type = TYPES_BY_PYTHON_TYPE[type.__name__]() except (KeyError, AttributeError): valid_parameter_types = [k for k in TYPES_BY_PYTHON_TYPE.keys()] raise InvalidParameterError( diff --git a/openhexa/sdk/pipelines/runtime.py b/openhexa/sdk/pipelines/runtime.py index 0556d097..c1e3195e 100644 --- a/openhexa/sdk/pipelines/runtime.py +++ b/openhexa/sdk/pipelines/runtime.py @@ -308,7 +308,7 @@ def get_pipeline(pipeline_path: Path) -> Pipeline: # Convert args spec to parameter kwargs param_kwargs = {k: v["value"] for k, v in parameter_args.items()} - parameter = Parameter(type=type_class, **param_kwargs) + parameter = Parameter(type=type_class.expected_type, **param_kwargs) pipeline_parameters.append(parameter) except KeyError as e: From ba3fcd57c75e70a118c4a380133be8453ac71e9b Mon Sep 17 00:00:00 2001 From: YolanFery Date: Fri, 3 Apr 2026 18:41:05 +0200 Subject: [PATCH 5/5] fix: type test --- tests/test_parameter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_parameter.py b/tests/test_parameter.py index 4813a50d..ea405112 100644 --- a/tests/test_parameter.py +++ b/tests/test_parameter.py @@ -106,7 +106,7 @@ def test_secret_type_normalize(): def test_secret_type_validate(): """Check validation for SecretType.""" secret_type = SecretType() - assert secret_type.validate("my-token") == "my-token" + assert secret_type.validate(Secret("my-token")) == "my-token" with pytest.raises(ParameterValueError): secret_type.validate(123)