Skip to content

Commit 8255b11

Browse files
Add implementation plan and update spec with ~~ naming
Implementation plan (specs/autopopulate-2.0-implementation.md): - JobsTable class with ~~ prefix naming convention - FK-only PK constraint for new tables, legacy support - Two execution modes: direct (default) and distributed - AutoPopulate mixin updates (jobs property, populate paths) - Schema.jobs returning list of JobsTable objects - Configuration options and testing strategy Spec updates (docs/src/compute/autopopulate2.0-spec.md): - Changed table naming from ~table__jobs to ~~table - Removed default value from priority (set by refresh()) - Priority default controlled by config['jobs.default_priority'] 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1e9e1ba commit 8255b11

File tree

2 files changed

+466
-6
lines changed

2 files changed

+466
-6
lines changed

docs/src/compute/autopopulate2.0-spec.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ The existing `~jobs` table has significant limitations:
4646

4747
### Jobs Table Structure
4848

49-
Each `dj.Imported` or `dj.Computed` table `MyTable` will have an associated hidden jobs table `~my_table__jobs` with the following structure:
49+
Each `dj.Imported` or `dj.Computed` table `MyTable` will have an associated hidden jobs table `~~my_table` with the following structure:
5050

5151
```
5252
# Job queue for MyTable
@@ -55,7 +55,7 @@ session_id : int
5555
... # Only FK-derived primary key attributes (NO foreign key constraints)
5656
---
5757
status : enum('pending', 'reserved', 'success', 'error', 'ignore')
58-
priority=5 : uint8 # Lower = more urgent (0 = highest priority)
58+
priority : uint8 # Lower = more urgent (0 = highest), set by refresh()
5959
created_time=CURRENT_TIMESTAMP : timestamp # When job was added to queue
6060
scheduled_time=CURRENT_TIMESTAMP : timestamp # Process on or after this time
6161
reserved_time=null : timestamp # When job was reserved
@@ -386,9 +386,11 @@ MyTable.jobs.refresh(Subject & 'priority="urgent"', priority=0)
386386

387387
### Table Naming Convention
388388

389-
Jobs tables follow the existing hidden table naming pattern:
389+
Jobs tables use the `~~` prefix (double tilde):
390390
- Table `FilteredImage` (stored as `__filtered_image`)
391-
- Jobs table: `~filtered_image__jobs` (stored as `_filtered_image__jobs`)
391+
- Jobs table: `~~filtered_image` (stored as `~~filtered_image`)
392+
393+
The `~~` prefix distinguishes jobs tables from other hidden tables (`~jobs`, `~lineage`) while keeping names short.
392394

393395
### Primary Key Constraint
394396

@@ -500,7 +502,7 @@ FilteredImage.jobs.refresh() # Re-adds as pending if key still in key_source
500502
When an auto-populated table is **dropped**, its associated jobs table is automatically dropped:
501503

502504
```python
503-
# Dropping FilteredImage also drops ~filtered_image__jobs
505+
# Dropping FilteredImage also drops ~~filtered_image
504506
FilteredImage.drop()
505507
```
506508

@@ -522,7 +524,7 @@ Jobs tables are created automatically on first use:
522524
```python
523525
# First call to populate with reserve_jobs=True creates the jobs table
524526
FilteredImage.populate(reserve_jobs=True)
525-
# Creates ~filtered_image__jobs if it doesn't exist, then populates
527+
# Creates ~~filtered_image if it doesn't exist, then populates
526528

527529
# Alternatively, explicitly create/refresh the jobs table
528530
FilteredImage.jobs.refresh()

0 commit comments

Comments
 (0)