Skip to content

fix: render 0-d integer and bool arrays as integer and checkbox inputs - #199

Open
singhharsh1708 wants to merge 1 commit into
pasteurlabs:mainfrom
singhharsh1708:fix/int-bool-scalar-inputs
Open

singhharsh1708 wants to merge 1 commit into
pasteurlabs:mainfrom
singhharsh1708:fix/int-bool-scalar-inputs

Conversation

@singhharsh1708

Copy link
Copy Markdown
Contributor

Relevant issue or PR

Follows #198.

Description of changes

A 0-d array input was always rendered as a float number_input, whatever its dtype. For an Int32 or Array[(), "bool"] field the app then sent 3.0, and the Tesseract rejected it with Array dtype 'float64' cannot be safely cast to 'int32' (or 'bool'). The field type now follows the declared dtype in the schema's dtype.examples: integers get the integer input and booleans a checkbox. The integer input also needed a step of 1 when no multipleOf is set, since its get("step", 1) fallback never applied (the key is always present, as None).

Testing done

  • An app for a Tesseract with Int32, Float32 and bool 0-d inputs, run against it served with tesseract-runtime serve: the request fails validation on main; here it returns {"result": 6.0}.
  • New tests fail on main and pass here; tests/test_parse.py passes except test_description_from_oas, which builds a Docker image and fails the same way on main without Docker.

@codecov

codecov Bot commented Nov 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.96%. Comparing base (4bc4581) to head (957430e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   86.64%   86.96%   +0.32%     
==========================================
  Files           5        5              
  Lines         322      330       +8     
  Branches       36       39       +3     
==========================================
+ Hits          279      287       +8     
  Misses         39       39              
  Partials        4        4              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant