| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
- Add FRAME_FORMAT_KEY constant - Add frame_format parameter to VideoScene dataclass - Update to_payload() to include frame_format when set - Supports 'jpeg' (default) or 'png' for lossless frame extraction - Bump version to 0.17.12
|
To be merged after https://github.com/scaleapi/scaleapi/pull/132674. |
Sorry, something went wrong.
There was a problem hiding this comment.
Looks good.
Since I was the only one who has redeployed a new SDK version in a while, lmk if help is needed for that part once this is merged.
Worth to take a look at greptile's comment as well
Sorry, something went wrong.
| def test_job_listing_and_retrieval(CLIENT): | ||
| jobs = CLIENT.list_jobs() | ||
| assert len(jobs) > 0, "No jobs found" | ||
| fetch_id = jobs[0].job_id | ||
| fetched_job = CLIENT.get_job(fetch_id) | ||
| # job_last_known_status can change | ||
| fetched_job.job_last_known_status = jobs[0].job_last_known_status | ||
| assert fetched_job == jobs[0] |
There was a problem hiding this comment.
Why is this considered broken?
Sorry, something went wrong.
There was a problem hiding this comment.
CLIENT.get_job(fetch_id)
Throws a 401 error. Honestly no one uses Nucleus jobs anymore though perhaps you'll use it for deduping.
Sorry, something went wrong.
There was a problem hiding this comment.
I changed/fixed this job as part of this pr, so prob best to just undo this change from this pr
Sorry, something went wrong.
|
Additional Comments (1)
nucleus/scene.py to_payload() correctly serializes frame_format into the payload (line 703-704), but from_json() does not extract it when deserializing. This means a round-trip through to_payload() → from_json() will silently drop the frame_format field. The existing test fixture video_scenes in tests/test_video_scene.py uses from_json to reconstruct scenes, so any scene with a frame_format set will lose that value. return cls(
reference_id=payload[REFERENCE_ID_KEY],
frame_rate=payload.get(FRAME_RATE_KEY, None),
items=items,
metadata=payload.get(METADATA_KEY, {}),
video_location=payload.get(VIDEO_URL_KEY, None),
tracks=tracks,
frame_format=payload.get(FRAME_FORMAT_KEY, None),
)
This is a comment left during a code review.
Path: nucleus/scene.py
Line: 672-679
Comment:
**`from_json` doesn't restore `frame_format`**
`to_payload()` correctly serializes `frame_format` into the payload (line 703-704), but `from_json()` does not extract it when deserializing. This means a round-trip through `to_payload()` → `from_json()` will silently drop the `frame_format` field. The existing test fixture `video_scenes` in `tests/test_video_scene.py` uses `from_json` to reconstruct scenes, so any scene with a `frame_format` set will lose that value.
```suggestion
return cls(
reference_id=payload[REFERENCE_ID_KEY],
frame_rate=payload.get(FRAME_RATE_KEY, None),
items=items,
metadata=payload.get(METADATA_KEY, {}),
video_location=payload.get(VIDEO_URL_KEY, None),
tracks=tracks,
frame_format=payload.get(FRAME_FORMAT_KEY, None),
)
```
How can I resolve this? If you propose a fix, please make it concise. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Greptile Summary
This PR adds an optional frame_format parameter to VideoScene to support PNG (lossless) frame extraction when uploading videos via video_location, defaulting to JPEG. It also bumps the version to 0.17.12 and removes a broken integration test.
Confidence Score: 2/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant VideoScene participant Payload as JSON Payload participant API as Nucleus API User->>VideoScene: Create with frame_format="png" VideoScene->>VideoScene: validate() VideoScene->>Payload: to_payload() Note over Payload: Includes frame_format: "png" Payload->>API: Upload scene API-->>Payload: Return scene JSON Payload->>VideoScene: from_json(payload) Note over VideoScene: ⚠️ frame_format is lost<br/>(not extracted from payload)Last reviewed commit: 6341865