fix(job): read job state field renamed from status#628
Conversation
The job endpoint response model (GetJobByIdEndpointOutput) was regenerated in 3.14.2 with its `status` field renamed to `state` (now an AudienceJobState enum), but RapidataJob.get_status() still read `.status`, raising AttributeError on every job status check (e.g. display_progress_bar, get_results). Read `.state.value` to restore the str return contract; the enum values (Completed, Failed, ...) already match the strings the callers compare against. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: lino <lino@rapidata.ai>
Code ReviewOverviewThis is a targeted hotfix for a broken Code CorrectnessThe fix is correct. Minor Observations (non-blocking)1. Since 2. Magic string comparisons throughout the file
3. Test coverage No unit tests are added, which is understandable for a hotfix. A simple mock-based test for Risk Assessment
VerdictApprove. The fix is correct, minimal, and unambiguous. The observations above are suggestions for follow-up, not blockers. |
What
RapidataJob.get_status()read.statusoff the job endpoint response, but the generated modelGetJobByIdEndpointOutputwas regenerated in 3.14.2 (commit38d0a17, "update OpenAPI client to 2026.06.17.1403") with that field renamed:So every job status check raised:
This surfaced in the scheduled
rapidata-testingRun SDK Orders workflow —job_test.py→display_progress_bar()→get_status()(failing run).Fix
Read
.state.value.AudienceJobStateis astrenum whose values (Completed,Failed, …) already match the strings_wait_for_statusanddisplay_progress_barcompare against, soget_status()keeps its-> strcontract and no caller needs changing.pyright src/rapidata/rapidata_clientpasses clean.🔗 Session: https://session-0eb86da9.poseidon.rapidata.internal/