{"record":{"id":"b0c61c1ac8c2aa24","repo":"openai/openai-python","slug":"expected-a-non-empty-value-for-video-id-but-rece","errorCode":null,"errorMessage":"Expected a non-empty value for `video_id` but received {video_id!r}","messagePattern":"Expected a non-empty value for `video_id` but received (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"src/openai/resources/videos.py","lineNumber":239,"sourceCode":"        extra_headers: Headers | None = None,\n        extra_query: Query | None = None,\n        extra_body: Body | None = None,\n        timeout: float | httpx2.Timeout | None | NotGiven = not_given,\n    ) -> Video:\n        \"\"\"\n        Fetch the latest metadata for a generated video.\n\n        Args:\n          extra_headers: Send extra headers\n\n          extra_query: Add additional query parameters to the request\n\n          extra_body: Add additional JSON properties to the request\n\n          timeout: Override the client-level default timeout for this request, in seconds\n        \"\"\"\n        if not video_id:\n            raise ValueError(f\"Expected a non-empty value for `video_id` but received {video_id!r}\")\n        return self._get(\n            path_template(\"/videos/{video_id}\", video_id=video_id),\n            options=make_request_options(\n                extra_headers=extra_headers,\n                extra_query=extra_query,\n                extra_body=extra_body,\n                timeout=timeout,\n                security={\"bearer_auth\": True},\n            ),\n            cast_to=Video,\n        )\n\n    @typing_extensions.deprecated(\"The Sora API is scheduled to permanently shut down on September 24, 2026.\")\n    def list(\n        self,\n        *,\n        after: str | Omit = omit,\n        limit: int | Omit = omit,","sourceCodeStart":221,"sourceCodeEnd":257,"githubUrl":"https://github.com/openai/openai-python/blob/9917c6e28e66e90e1227b3d223c06a8c5441515a/src/openai/resources/videos.py#L221-L257","documentation":"The Videos.retrieve method requires a non-empty video_id string because it is interpolated directly into the request path /videos/{video_id}. The SDK validates path parameters up front and raises ValueError before any HTTP request is made when the value is empty (\"\" or None). This mirrors the poll helper, which calls retrieve on each iteration until the video completes.","triggerScenarios":"Calling client.videos.retrieve(video_id=\"\"), passing None, or calling client.videos.poll(video_id) with an empty/None id; also using a variable that was never assigned from the create() response.","commonSituations":"Storing the create response but reading the wrong attribute (e.g. response.id vs response.video_id), passing a dict instead of the model object, or a f-string that evaluates to empty.","solutions":["Check that video_id is a non-empty string before calling retrieve/poll","Use the id returned from client.videos.create(...) exactly as given","Add an assert or early return when the variable holding the id is empty"],"exampleFix":"// before\nvideo = client.videos.poll(video_id=\"\")\n\n// after\ncreated = client.videos.create(model=\"sora-2\", prompt=\"...\")\nvideo = client.videos.poll(video_id=created.id)","handlingStrategy":"validation","validationCode":"if not isinstance(video_id, str) or not video_id.strip():\n    raise ValueError(\"video_id must be a non-empty string\")","typeGuard":"def is_valid_video_id(v: object) -> TypeGuard[str]:\n    return isinstance(v, str) and bool(v.strip())","tryCatchPattern":null,"preventionTips":["Always source video_id from the create() response's id field","Validate ids at the boundary of your app before passing to the SDK"],"tags":["videos","path-parameter","validation","valueerror"],"backgroundTag":"missing-required-parameter","analyzedSha":"9917c6e28e66e90e1227b3d223c06a8c5441515a","analyzedAt":"2026-08-28T11:46:34.183Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}