feat(job): expose locate job definition#612
Conversation
Promote create_locate_job_definition from private to public on the job manager and add a Locate example to the docs (page + nav + llms.txt), matching the existing classify/compare examples. The order-API equivalent is deprecated in favour of jobs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: karl <karl@rapidata.ai>
Add a Locate column to the parameter availability matrix, a datapoints format row, and a short Locate Job note. Locate has no job-specific parameters and does not accept data_type / confidence_threshold / quorum_threshold. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: karl <karl@rapidata.ai>
Add the Locate job type to the "What you can do" table on the docs landing page so it sits alongside Compare and Classify now that it is public. Revert the locate docstring opener from "With this job" back to "With this order" to match the other seven create_*_job_definition methods in the manager. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-Authored-By: karl <karl@rapidata.ai>
Code ReviewOverviewThis PR exposes the previously-private Code Quality
Docstring opener ( Documentation
Actionable Suggestions
SummaryClean, well-scoped PR. The core change is a single-line rename with no downstream callers to update. Documentation is thorough and consistent. The only material gap is test coverage for the newly public method. Everything else is minor polish. |
…ce results The classify/compare/locate example pages created a brand-new empty audience and immediately assigned a job to it. A fresh audience has no graduated labelers, so the job never collected responses and the examples never produced results. Mirror the 2.x Basic/Advanced split using the 3.x audience model: - Simple tab runs on a curated audience that already has trained labelers (classify -> Coherence, compare -> Alignment, locate -> Global Audience), selected by exact name so -created_at ordering can't pick a stale custom audience. - Advanced tab (classify, compare) builds a custom audience and trains it with qualification examples before assigning the job. Locate has no Advanced tab because the audience API exposes no locate qualification examples yet. Co-Authored-By: karl <karl@rapidata.ai>
Code Review: feat(job): expose locate job definitionOverviewThis PR exposes The core change is a single-character rename. The implementation was already solid — this PR makes it accessible to customers. Code Quality
All three public Documentation
Clear and well-scoped. The note that locate doesn't support custom qualification examples sets the right expectations. The
Potential Issues
SummaryThis is a clean, low-risk change. The rename is the right approach and the docs are accurate. The Simple/Advanced example refactor is a genuine improvement to the existing pages. Suggested items before merge:
|
Code ReviewOverviewThis PR exposes the previously-private Correctness Issues1. Missing input validation on the newly-public method (
# classification does this:
if not isinstance(datapoints, list) or not all(
isinstance(datapoint, str) for datapoint in datapoints
):
raise ValueError("Datapoints must be a list of strings")Since this is now a public API surface, passing a wrong type will currently fall through to an internal 2. Stale The PR correctly migrates Minor Observations3. The new pattern used across all examples: audience = next(
a for a in client.audience.find_audiences("Alignment") if a.name == "Alignment"
)…raises audience = next(
(a for a in client.audience.find_audiences("Alignment") if a.name == "Alignment"),
None
)
if audience is None:
raise ValueError("Curated 'Alignment' audience not found — check the Dashboard")This is a docs concern rather than a blocker, but the landing-page examples especially will be copied verbatim by new users. 4. The function signature defaults to 5. Parameter matrix row for The matrix marks both What's Well Done
SummaryTwo things worth fixing before merge:
Everything else is advisory. |
LinoGiger
left a comment
There was a problem hiding this comment.
i think it also makes sense to add the ability to add locate examples to the audience
Addresses review feedback on PR #612: - Replace the brittle next(... if a.name ==) audience lookup with get_audience_by_id across the example, quickstart and landing pages (Coherence=aud_mr3NbeWa4Uo, Alignment=aud_MU1GZYoESyO, global="global"). - Move the qualification-example caveat to a short reference link and add a warning above the Advanced code blocks that building a new audience takes significantly longer. - Correct the locate prose: a locate job can run on any audience, not only the global one. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Co-Authored-By: karl <karl@rapidata.ai>
LinoGiger
left a comment
There was a problem hiding this comment.
i think this is mostly good now, just missing the adding of the locate example. we can maybe also have an advanced example for that?
What & why
Exposes the previously-private
_create_locate_job_definitionas a publicclient.job.create_locate_job_definition, so customers can create locate jobs (labelers tap the points in a datapoint that match an instruction) directly from the SDK — and documents it.This closes the gap raised in two Poseidon sessions: customers were told a locate endpoint exists, but it was private and undocumented in the 3.x docs.
While documenting locate, we also fixed a latent bug across all the 3.x example docs: every example created a brand-new empty audience and immediately assigned a job to it. A freshly-created audience has no graduated labelers, so the job never collects responses and
get_results()never returns — i.e. none of the examples actually ran.Changes
Locate job (original scope)
rapidata_job_manager.py— rename_create_locate_job_definition→create_locate_job_definition(now public;mkdocstringsfilters: ["!^_"]means only the public name renders in the API reference).docs/examples/locate_job.md— new worked example, wired intomkdocs.ymlnav.docs/job_definition_parameters.md— locate added to the datapoints table, a dedicated Locate section, and the parameter-availability matrix.docs/starting_page.md— locate added to the "What you can do" landing-page table.create_*_job_definitionmethods.Example docs that actually run (added in this PR)
docs/examples/classify_job.mdanddocs/examples/compare_job.md— restructured into Simple / Advanced content tabs (mirroring the 2.x docs):add_classification_example/add_compare_example) before assigning the job.docs/examples/locate_job.md— switched off the deadcreate_audience(...)onto the curated Global audience; no Advanced tab (the audience API has no locate qualification examples yet — noted inline).docs/quickstart.md— same fix applied to Step 1 and the Complete Example.next(a for a in client.audience.find_audiences("X") if a.name == "X")— becausefind_audiencesdoes a substring match sorted newest-first, so[0]would grab a stale custom audience and re-introduce the empty-audience bug.Consistency review (done in-session)
create_<type>_job_definitionpattern of the public siblings (classification, compare). ✓data_type/confidence_threshold/quorum_threshold, matching the parameter-availability matrix. ✓order,validation,job). ✓mkdocs build --strictintroduces no new warnings (same 5 pre-existingmri.md+box.pybaseline warnings). ✓Note on deployment
docs.rapidata.aiis not auto-deployed on merge — theDeploy Documentationworkflow isworkflow_dispatchonly. After merge, someone needs to run it (branchmain, alias3.x, set latest) for these docs + the new API-reference entry to go live.🔗 Session: https://session-9964dbce.poseidon.rapidata.internal/