GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add delivery task response API by stuartdietrich · Pull Request #106 · scaleapi/scaleapi-python-client

Conversation

@stuartdietrich

@stuartdietrich stuartdietrich commented Apr 24, 2026 •
edited by greptile-apps Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Pull Request Summary

Description

Please include a summary of the changes. Please also include the relevant context and motivation. List any dependencies and assumptions that are required for this change.

Add delivery task response API

How did you test your code?

Which of the following have you done to test your changes? Please describe the tests that you ran to verify your changes.

  • Created new unit tests in tests/ for the newly implemented methods
  • Updated existing unit tests in tests/ to cover changes made to existing methods

Checklist

Please make sure all items in this checklist have been fulfilled before sending your PR out for review!

  • I have commented my code in details, particularly in hard-to-understand areas
  • I have updated Readme.rst document with examples for newly implemented public methods
  • I have reviewed Deployment and Publishing Guide for Python SDK document
  • I incremented the SDK version in _version.py (unless this PR only updates the documentation).
  • In order to release a new version, a "Release Summary" needs to be prepared and published after the merge

Greptile Summary

This PR adds two new API endpoints to the Python SDK — GET /v2/delivery/tasks (retrieve tasks with their delivered response data) and GET /v2/schema (retrieve a delivery JSON schema by ID) — along with their supporting Pydantic models. It also removes the GenAIProjectType enum from generation, replacing the Project.types field with List[StrictStr].

  • delivered_at in GetDeliveryTasksResponseDocsInner is typed as Optional[StrictStr] while created_at on the same model is Optional[datetime]; callers expecting a datetime object for delivered_at will receive a raw string instead.
  • Removing GenAIProjectType and changing Project.types to List[StrictStr] is a breaking change for any existing callers comparing against enum values.

Confidence Score: 4/5

Safe to merge after confirming whether delivered_at should be datetime or StrictStr.

One P1 finding: delivered_at is typed as StrictStr while the description and its sibling field created_at indicate it should be a datetime. If the upstream API returns a non-standard date string, StrictStr is intentional — but if the format is ISO 8601, the inconsistency will confuse callers. The GenAIProjectType removal is a breaking change but appears intentional per the generator config updates.

scaleapi/api_client/v2/models/get_delivery_tasks_response_docs_inner.py — verify delivered_at field type.

Important Files Changed

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.

Sequence Diagram

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)
Loading

Comments Outside Diff (3)

  1. scaleapi/api_client/v2/models/project.py, line 760 (link)

    P1 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.

    Prompt To Fix With AI
    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.

    Fix in Cursor Fix in Claude Code

  2. scaleapi/api_client/v2/models/__init__.py, line 528 (link)

    P1 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.

    Prompt To Fix With AI
    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.

    Fix in Cursor Fix in Claude Code

  3. scaleapi/api_client/v2/models/get_delivery_tasks_response_docs_inner.py, line 980 (link)

    P1 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.

    Prompt To Fix With AI
    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.

    Fix in Cursor Fix in Claude Code

Fix All in Cursor Fix All in Claude Code

Prompt To Fix All With AI
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.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
stuartdietrich added 3 commits April 24, 2026 09:31
@stuartdietrich
add new apis
02e0c54
@stuartdietrich
fix project types
cf67ddf
@stuartdietrich
add more fields
b8fc2c7
@rishabh-shah-scale
rishabh-shah-scale self-requested a review April 24, 2026 17:58
rishabh-shah-scale
rishabh-shah-scale approved these changes Apr 24, 2026
View reviewed changes

@rishabh-shah-scale rishabh-shah-scale left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@fatihkurtoglu
fatihkurtoglu self-requested a review April 24, 2026 17:59
fatihkurtoglu
fatihkurtoglu approved these changes Apr 24, 2026
View reviewed changes
@stuartdietrich
add schema api
d1be715
@stuartdietrich
stuartdietrich merged commit b4111b2 into master Apr 24, 2026
4 checks passed

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

2 more reviewers
@fatihkurtoglu fatihkurtoglu fatihkurtoglu approved these changes
@rishabh-shah-scale rishabh-shah-scale rishabh-shah-scale approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@stuartdietrich @fatihkurtoglu @rishabh-shah-scale
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.