Skip to content

fix: handle null metric values from platform API changes#88

Merged
rdheekonda merged 1 commit into
mainfrom
bugfix/handle-null-metric-values
Jun 24, 2025
Merged

fix: handle null metric values from platform API changes#88
rdheekonda merged 1 commit into
mainfrom
bugfix/handle-null-metric-values

Conversation

@rdheekonda
Copy link
Copy Markdown
Contributor

@rdheekonda rdheekonda commented Jun 23, 2025

Issue: SDK failing with Pydantic validation errors after platform API hotfix for NaN handling in metrics.

Root Cause:

  • Platform API now converts NaN → null in JSON responses (hotfix #1920)
  • SDK Metric model expects float but receives None for undefined metrics
  • Pydantic validation fails: "Input should be a valid number [type=float_type, input_value=None]"

Solution:

  • Updated Metric.value type from float to float | None
  • Maintains backward compatibility while supporting new API behavior

Testing:
✅ Verified SDK can parse responses with null metric values
✅ Existing functionality preserved for valid float values
✅ Authentication and project listing work correctly

Related: Platform API hotfix #1920 - NaN JSON serialization fix

Compatible with platform API changes that convert NaN evaluation metrics to null.

Generated Summary:

  • Changed the type of value in the Metric class from float to float | None.
  • This allows value to also be None, providing greater flexibility in representing metrics without a defined value.
  • Impact: Potentially avoids issues where a metric may not be applicable or is unknown, improving data integrity.

This summary was generated with ❤️ by rigging

@rdheekonda rdheekonda requested a review from monoxgas June 23, 2025 23:59
@rdheekonda rdheekonda merged commit de02ced into main Jun 24, 2025
9 checks passed
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