Skip to content

docs: jobs.list() returns Job objects, and how to read job.properties - #6

Merged
infusini merged 1 commit into
mainfrom
docs/jobs-list-returns-job-objects
Sep 1, 2026
Merged

infusini merged 1 commit into
mainfrom
docs/jobs-list-returns-job-objects

Conversation

@infusini

@infusini infusini commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Why

The README's Jobs section was two lines and did not say what jobs.list() returns:

# List available dataset jobs
jobs = client.jobs.list()

Two things make that a problem now:

  1. The return type changed. Since 0.3.5 (e2058a9, released by the bump in 1feda40)
    client.jobs.list() returns List[Job] rather than List[Dict[str, Any]]. Callers written
    against the old shape fail with AttributeError: 'dict' object has no attribute 'slug'. Note
    the raw payload also spelled the published flag isPublished, where Job exposes
    is_published.
  2. job.properties is now the documented path. With the dataset builders deprecated in
    53e6f75, reading a job's parameter definition and constructing a generic Dataset is the way
    to build job_run_params — but nothing said so, or said where to look.

This came out of writing a customer-facing script: the missing docs cost a real debugging cycle,
including a 400 that was only explicable by probing the live API.

What changed

Docs only — README.md, +31 lines, no code touched.

  • The Job field shape (slug, name, run_type, is_published, description, properties)
  • A short example walking job.properties to list a job's parameters and which are required
  • The two things that catch people out converting properties into job_run_params:
    • input_datasets is listed in the definition but is not a job_run_params key — the server
      populates it from input_dataset_ids
    • filter_values_criteria is a string selector ("percentage" / "count") with a matching
      sibling field (filter_threshold_percentage / filter_threshold_count), not a nested dict
  • A "Changed in 0.3.5" note for the return type

Verification

The 0.3.5 attribution was traced rather than assumed: List[Job] was introduced in e2058a9 while
pyproject.toml still read 0.3.4; the next bump (1feda40) set 0.3.5, so that is the first
release containing it. The properties field names in the example were read from a live
GET /jobs response.

Follow-up, not in this PR

CHANGELOG.md still tops out at ## [0.3.4] while the project is at 0.3.12 — eight undocumented
releases, including this breaking return-type change and the builder deprecations. Happy to add
those entries if wanted.

🤖 Generated with Claude Code

The Jobs section was two lines and did not say what came back. Since 0.3.5
jobs.list() returns List[Job] rather than List[Dict], which silently breaks
callers doing job["slug"] — and job.properties is now the documented way to
find out what a dataset's job_run_params should contain, given the dataset
builders are deprecated.

Adds the Job field shape, an example of walking properties, the two things
that catch people out when turning properties into job_run_params
(input_datasets is server-populated; filter_values_criteria is a string
selector with a sibling threshold field), and a note about the return-type
change.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@infusini
infusini merged commit 8157b19 into main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant