fix(sds): hide field options that come back as an empty list - #802
Merged
Merged
Conversation
An unconfigured SDS entity is a bare empty list with no display flag. Treating every list as displayed turned those into free-text questions. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Code Review The fix is correct: Two minor pattern notes (not blocking):
Summary: 0 bugs found. Fix is correct and well-tested; only minor style/convention nits. |
prasad-albert
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An SDS field the tenant has not configured no longer shows up as a question. Viscosity - SDS Output, pH - SDS Output, and the other Section 9 fields that come back as a bare empty list are now hidden.
Why
Those entities are not in the TEN1 or TEN5 field configuration. The field-options endpoint returns
[]for them, with no display flag.get_field_optionsstored every list as displayed, so Ask Albert rendered them as free-text inputs. EX-2811.How
A bare empty list means the field is not configured, so
displayis false. A non-empty list is still the option list and stays displayed. An object that already saysdisplay: trueis unchanged, including a free-text field whosedatais empty.Testing
uv run ruff format src/albert/collections/sds.py tests/unit/collections/test_sds.pyuv run ruff check src/albert/collections/sds.py tests/unit/collections/test_sds.pyuv run pytest tests/unit/collections/test_sds.py -vSDK Changes
sds.get_field_optionsreportsdisplay=Falsewhen the field-options response is an empty list.