chore: remove files endpoints in favor of uploads - #145
Conversation
|
|
||
| from pydantic import Field, StrictBytes, StrictStr | ||
| from typing import Optional, Tuple, Union | ||
| from pydantic import Field, StrictStr |
There was a problem hiding this comment.
Blocking: This PR removes the generated upload_file / _upload_file_serialize op and the UploadResponse model, but the hand-written wrapper hotdata/uploads.py (not regenerated here) still depends on both:
hotdata/uploads.py:73— module-levelfrom hotdata.models.upload_response import UploadResponse. That module is deleted by this PR, soimport hotdatanow raisesModuleNotFoundError(hotdata/__init__.py:332importsfrom hotdata.uploads import UploadsApi). The entire package fails to import.hotdata/uploads.py:1183and:1208callself._upload_file_serialize(...), which this PR removed from the generatedUploadsApi, soupload_stream()would raiseAttributeErroreven if the import were fixed.
The hand-written legacy POST /v1/files fallback (upload_stream, _UPLOAD_FILE_RESPONSE_TYPES, the UploadResponse import) and the README section documenting it (README.md:159-165) must be updated in the same change that removes the generated endpoints — otherwise the SDK is unimportable.
There was a problem hiding this comment.
Review — Blocking Issues
The package no longer imports. This auto-generated PR removes the POST/GET /v1/files endpoints and their models (UploadResponse, UploadInfo, ListUploadsResponse) plus the generated upload_file / list_uploads ops and _upload_file_serialize. But the hand-written wrapper hotdata/uploads.py — which is not regenerated and not part of this diff — still depends on the deleted code:
- hotdata/uploads.py:73 has a module-level
from hotdata.models.upload_response import UploadResponse. Since hotdata/init.py:332 doesfrom hotdata.uploads import UploadsApi,import hotdatanow fails with ModuleNotFoundError: No module namedhotdata.models.upload_response. - hotdata/uploads.py:1183 and :1208 call self._upload_file_serialize(...), which was removed from the generated UploadsApi; upload_stream() would raise AttributeError.
Action Required — update the hand-written layer in the same change that drops the generated endpoints:
- Remove (or rework) the legacy POST /v1/files fallback in hotdata/uploads.py: the UploadResponse import, _UPLOAD_FILE_RESPONSE_TYPES, and the upload_stream method that relies on _upload_file_serialize.
- Update the README section documenting upload_stream / POST /v1/files (README.md:159-165) and the CHANGELOG entry referencing the legacy endpoint.
- Confirm
import hotdatasucceeds and the test suite passes before merge.
There was a problem hiding this comment.
Prior blocking issue resolved: the deleted UploadResponse model, _upload_file_serialize/upload_stream legacy fallback, and the README /v1/files section are all removed, and hotdata/uploads.py now imports only existing symbols. Package-wide grep confirms no dangling references. LGTM.
Auto-generated from the updated HotData OpenAPI spec.
Source: https://github.com/hotdata-dev/www.hotdata.dev/pull/270