Skip to content

[AI-FSSDK] [FSSDK-12750] Use attribute id instead of key for CMAB prediction requests#402

Merged
esrakartalOpt merged 2 commits into
masterfrom
ai/raju-opti/FSSDK-12750-cmab-attribute-id-fix
Jul 2, 2026
Merged

[AI-FSSDK] [FSSDK-12750] Use attribute id instead of key for CMAB prediction requests#402
esrakartalOpt merged 2 commits into
masterfrom
ai/raju-opti/FSSDK-12750-cmab-attribute-id-fix

Conversation

@raju-opti

@raju-opti raju-opti commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

The CMAB service's filter_attributes method was using the attribute's key as the map key when building the filtered attributes hash for CMAB prediction requests. The CMAB prediction endpoint expects the attribute's id in the "id" field of the JSON payload, not the key. This change updates the method to use the attribute id as the hash key so the downstream HTTP request sends the correct identifier.

Changes

  • Updated filter_attributes in CmabService to use attribute_id instead of attribute_key as the hash key for filtered attributes
  • Added a defensive guard for malformed datafiles where attributeIds is nil or non-Array
  • Updated existing test expectations to reflect attribute IDs as hash keys and added edge case tests

Jira Ticket

FSSDK-12750

…ai/raju-opti/FSSDK-12750-cmab-attribute-id-fix
@esrakartalOpt esrakartalOpt merged commit 64be8ad into master Jul 2, 2026
9 of 10 checks passed
@esrakartalOpt esrakartalOpt deleted the ai/raju-opti/FSSDK-12750-cmab-attribute-id-fix branch July 2, 2026 16:33
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