GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — Add delivery task response API by stuartdietrich · Pull Request #106 · scaleapi/scaleapi-python-client Conversation
|
| Filename | Overview |
|---|---|
| scaleapi/api_client/v2/api/v2_api.py | Adds get_delivery_tasks (GET /v2/delivery/tasks) and get_schema (GET /v2/schema) endpoints, each with standard, with-http-info, and without-preload-content variants; implementation follows the existing codebase patterns correctly. |
| scaleapi/api_client/v2/models/get_delivery_tasks_response_docs_inner.py | New model for individual task entries; delivered_at is typed as StrictStr despite being a UTC timestamp, inconsistent with created_at: datetime on the same model. |
| scaleapi/api_client/v2/models/get_delivery_tasks_response.py | New paginated response model for delivery tasks; standard structure matching other response models in the codebase. |
| scaleapi/api_client/v2/models/get_schema_response.py | New response model wrapping GetSchemaResponseSchema; clean implementation with proper alias handling for the reserved schema name. |
| scaleapi/api_client/v2/models/get_schema_response_schema.py | Schema model with id and var_json (aliased to json); var_json typed as StrictStr for the stringified JSON schema definition, which is correct per the API description. |
| scaleapi/api_client/v2/models/project.py | Removes GenAIProjectType import and changes types from List[GenAIProjectType] to List[StrictStr]; breaking change for callers using the enum but aligned with removing gen_ai_project_type.py from generation. |
| scaleapi/_version.py | Version bumped from 2.18.3 to 2.18.4 as required. |
sequenceDiagram
participant C as Caller
participant SDK as Python SDK (V2Api)
participant API as Scale API
C->>SDK: get_delivery_tasks(delivery_id, project_id, status, ...)
SDK->>API: GET /v2/delivery/tasks?delivery_id=...&status=...
API-->>SDK: 200 GetDeliveryTasksResponse { docs, total, next_token }
SDK-->>C: GetDeliveryTasksResponse
C->>SDK: get_schema(schema_id)
SDK->>API: GET /v2/schema?schema_id=...
API-->>SDK: 200 GetSchemaResponse { schema: { id, json } }
API-->>SDK: 400 GetSchema400Response
API-->>SDK: 404 GetSchema404Response
SDK-->>C: GetSchemaResponse (or raises on 4xx/5xx)
scaleapi/api_client/v2/models/project.py, line 760 (link)
Breaking API change with only a patch version bump
Project.types is changed from Optional[List[GenAIProjectType]] to Optional[List[StrictStr]], and GenAIProjectType is removed from the public __init__.py exports. Any caller that imports GenAIProjectType via from scaleapi.api_client.v2 import GenAIProjectType (or from scaleapi.api_client.v2.models import GenAIProjectType) will receive an ImportError after upgrading. Code that type-checks against the enum values will also break silently.
The version was only bumped from 2.18.3 → 2.18.4 (patch), which by semver convention signals no breaking changes. This should be at least a minor version bump to signal incompatibility.
This is a comment left during a code review. Path: scaleapi/api_client/v2/models/project.py Line: 760 Comment: **Breaking API change with only a patch version bump** `Project.types` is changed from `Optional[List[GenAIProjectType]]` to `Optional[List[StrictStr]]`, and `GenAIProjectType` is removed from the public `__init__.py` exports. Any caller that imports `GenAIProjectType` via `from scaleapi.api_client.v2 import GenAIProjectType` (or `from scaleapi.api_client.v2.models import GenAIProjectType`) will receive an `ImportError` after upgrading. Code that type-checks against the enum values will also break silently. The version was only bumped from `2.18.3` → `2.18.4` (patch), which by semver convention signals no breaking changes. This should be at least a minor version bump to signal incompatibility. How can I resolve this? If you propose a fix, please make it concise.
scaleapi/api_client/v2/models/__init__.py, line 528 (link)
GenAIProjectType silently removed from public API
GenAIProjectType is dropped from both models/__init__.py and api_client/v2/__init__.py in a patch version bump (2.18.3 → 2.18.4). The physical file (gen_ai_project_type.py) still exists on disk, but any user code doing from scaleapi.api_client.v2 import GenAIProjectType or from scaleapi.api_client.v2.models import GenAIProjectType will now raise an ImportError. Additionally, Project.types was narrowed from List[GenAIProjectType] to List[StrictStr], silently dropping enum validation.
This is a backward-incompatible change that is unrelated to the stated PR goal ("Add delivery task response API") and is undocumented in the PR description. Please either revert it or bump the minor version and add a migration note.
This is a comment left during a code review. Path: scaleapi/api_client/v2/models/__init__.py Line: 528 Comment: **`GenAIProjectType` silently removed from public API** `GenAIProjectType` is dropped from both `models/__init__.py` and `api_client/v2/__init__.py` in a **patch** version bump (2.18.3 → 2.18.4). The physical file (`gen_ai_project_type.py`) still exists on disk, but any user code doing `from scaleapi.api_client.v2 import GenAIProjectType` or `from scaleapi.api_client.v2.models import GenAIProjectType` will now raise an `ImportError`. Additionally, `Project.types` was narrowed from `List[GenAIProjectType]` to `List[StrictStr]`, silently dropping enum validation. This is a backward-incompatible change that is unrelated to the stated PR goal ("Add delivery task response API") and is undocumented in the PR description. Please either revert it or bump the minor version and add a migration note. How can I resolve this? If you propose a fix, please make it concise.
scaleapi/api_client/v2/models/get_delivery_tasks_response_docs_inner.py, line 980 (link)
delivered_at typed as StrictStr inconsistent with created_at: datetime
delivered_at is described as "UTC timestamp when the task was delivered" but is typed as Optional[StrictStr], while created_at on the same model is correctly typed as Optional[datetime]. This means callers cannot use datetime operations on delivered_at without manually parsing it, creating an inconsistency in the model interface.
This is a comment left during a code review. Path: scaleapi/api_client/v2/models/get_delivery_tasks_response_docs_inner.py Line: 980 Comment: **`delivered_at` typed as `StrictStr` inconsistent with `created_at: datetime`** `delivered_at` is described as "UTC timestamp when the task was delivered" but is typed as `Optional[StrictStr]`, while `created_at` on the same model is correctly typed as `Optional[datetime]`. This means callers cannot use datetime operations on `delivered_at` without manually parsing it, creating an inconsistency in the model interface. How can I resolve this? If you propose a fix, please make it concise.
This is a comment left during a code review. Path: scaleapi/api_client/v2/models/get_delivery_tasks_response_docs_inner.py Line: 980 Comment: **`delivered_at` typed as `StrictStr` inconsistent with `created_at: datetime`** `delivered_at` is described as "UTC timestamp when the task was delivered" but is typed as `Optional[StrictStr]`, while `created_at` on the same model is correctly typed as `Optional[datetime]`. This means callers cannot use datetime operations on `delivered_at` without manually parsing it, creating an inconsistency in the model interface. ```suggestion delivered_at: Optional[datetime] = Field(default=None, description="UTC timestamp when the task was delivered. Null if task has no delivered response.") ``` How can I resolve this? If you propose a fix, please make it concise.
Reviews (4): Last reviewed commit: "add schema api" | Re-trigger Greptile
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.