Skip to content

fix: Use a whole-number float for int() in the function-call fixture - #190

Open
leongdl wants to merge 1 commit into
OpenJobDescription:mainlinefrom
leongdl:fix-expr1.1-int-non-whole-float
Open

leongdl wants to merge 1 commit into
OpenJobDescription:mainlinefrom
leongdl:fix-expr1.1-int-non-whole-float

Conversation

@leongdl

@leongdl leongdl commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

expr1.1--function-call-expr.yaml is a valid-template fixture, but with its own defaults it can't create a job. Y defaults to 3.7, and the fixture calls {{ int(Param.Y) }}. RFC 0006 says that call is an error: "If the value cannot be nondestructively converted, it's an error. E.g. int(3.75) is an error, the functions floor, ceil, and round are for this case."

This change replaces that line with {{ int(float(Param.X)) }}, which still exercises int() on a FLOAT, now with a whole-number value (5.0 → 5). The floor/ceil/round lines already cover Param.Y, so its 3.7 default stays.

Why CI didn't catch it

run_openjd_cli_tests.py judges job_templates/ with openjd check alone, which doesn't evaluate expressions against parameter defaults. openjd-model 0.10.0 (openjd-rs#407) reports every evaluation error at job creation, so any implementation that instantiates a job from this template now rejects it:

openjd-cli 0.3.0 (openjd-model 0.10.0) before after
openjd check passes passes
openjd summary Cannot convert 3.7 to int: not a whole number passes
openjd run --step Step1 same error, exit 1 exits 0, prints 5 for the new line

This was found by a service conformance harness that submits every valid job_templates/ fixture through job creation.


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Signed-off-by: David Leong <leongdl@amazon.com>
@leongdl
leongdl requested a review from a team as a code owner September 30, 2026 02:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants