Skip to content

Fix daily activity model: correct MET field structure#24

Merged
godely merged 2 commits intomainfrom
fix-daily-activity-model
Jun 22, 2025
Merged

Fix daily activity model: correct MET field structure#24
godely merged 2 commits intomainfrom
fix-daily-activity-model

Conversation

@godely
Copy link
Owner

@godely godely commented Jun 21, 2025

Summary

  • Fix MET field in daily activity model to use proper TimeSeriesData structure instead of raw string
  • Add MetData class with interval, items, and timestamp fields for structured MET data
  • Implement comprehensive error handling system with custom exceptions
  • Add retry logic with exponential backoff for transient failures
  • Standardize URL handling across all endpoints (remove duplicate /v2 prefixes)
  • Add utility functions for consistent query parameter building

Test plan

  • All existing tests pass
  • Linting passes (flake8)
  • MET data is now properly structured as time-series data
  • Error handling works for various HTTP status codes
  • Retry logic handles transient failures appropriately

🤖 Generated with Claude Code

The MET field in daily activity data is a complex object containing
time-series data, not a simple string. Added MetData model to properly
handle the structure with interval, items array, and timestamp.

This fix resolves validation errors when retrieving real daily activity
data from the Oura API.
@godely godely force-pushed the fix-daily-activity-model branch from 4747d63 to 431fe4e Compare June 21, 2025 23:57
The test was using a string for the 'met' field but the model now expects
a structured MetData object with interval, items, and timestamp fields.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@godely godely merged commit d45930e into main Jun 22, 2025
1 check passed
@godely godely deleted the fix-daily-activity-model branch June 22, 2025 02:51
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