You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[feat] Regenerate pyatlan_v9 models with updated Pkl generator
- Regenerate all asset models using updated Pkl generator:
- set[str] fields now generated natively (no post-sync sed patch)
- validate/minimize/relate methods removed (dead code)
- relationship_attributes field in RelatedEntity base class
- Move overlay files to SDK repo (_overlays/ directory)
- Fix overlay imports: ai_model.py, collection.py, connection.py
- Add ruff exclusion for _overlays/ and F821 per-file-ignores
- Update generate-v9-models skill: sdkOnly mode, temp staging,
ruff auto-fix+format step, removed asset.py sed patch
- Update process_test.py to use Process.generate_qualified_name
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: .claude/skills/generate-v9-models/SKILL.md
+28-31Lines changed: 28 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,25 +36,28 @@ fi
36
36
37
37
### 2. Run Pkl evaluation
38
38
39
-
From the models repo root, run the Pkl code generator with SDK mode enabled:
39
+
From the models repo root, run the Pkl code generator in **SDK-only mode** (`-p sdkOnly=true`). This generates only Python SDK files — no JSON typedefs, no frontend code, no samples.
40
+
41
+
Use a temp directory for staging so no generated files land in the models repo:
-`-p sdkOnly=true` skips JSON typedef generation — only Python SDK files are produced
51
55
-`sdkOverlaysBasePath` must be an absolute path — Pkl resolves `read?()` relative to the module file, not CWD
52
-
- The `-p sdk=true` flag enables SDK code generation (search field descriptors, overlay injection, etc.)
53
-
- Output goes to `models/gen_v9/pyatlan_v9/model/assets/` as a staging area
56
+
- Output goes to a temp staging directory (nothing written to models repo)
54
57
55
58
### 3. Selective sync
56
59
57
-
Copy generated files to the SDK, **excluding** these files that have manual patches or are hand-written:
60
+
Copy generated files from the staging dir to the SDK, **excluding** these files that have manual patches or are hand-written:
58
61
59
62
| File | Reason |
60
63
|------|--------|
@@ -81,55 +84,49 @@ rsync -av \
81
84
--exclude='quick_sight_dataset_field.py' \
82
85
--exclude='quick_sight_folder.py' \
83
86
--exclude='data_quality_rule.py' \
84
-
gen_v9/pyatlan_v9/model/assets/ \
87
+
"${STAGING_DIR}/pyatlan_v9/model/assets/" \
85
88
"${SDK_DIR}/pyatlan_v9/model/assets/"
89
+
90
+
# Clean up staging dir
91
+
rm -rf "$STAGING_DIR"
86
92
```
87
93
88
-
16 additional types in pyatlan_v9 (persona.py, purpose.py, badge.py, access_control.py, etc.) are hand-written and NOT generated by Pkl — rsync won't touch them since they don't exist in gen_v9.
94
+
16 additional types in pyatlan_v9 (persona.py, purpose.py, badge.py, access_control.py, etc.) are hand-written and NOT generated by Pkl — rsync won't touch them since they don't exist in staging.
89
95
90
96
### 4. Post-sync patches
91
97
92
-
**a) asset.py** — replace `list[str]` with `set[str]` for 7 fields (in both `Asset` and `AssetAttributes` classes):
93
-
94
-
```bash
95
-
cd"${SDK_DIR}"
96
-
sed -i '' \
97
-
's/\(owner_users: \)list\[str\]/\1set[str]/g;
98
-
s/\(owner_groups: \)list\[str\]/\1set[str]/g;
99
-
s/\(admin_users: \)list\[str\]/\1set[str]/g;
100
-
s/\(admin_groups: \)list\[str\]/\1set[str]/g;
101
-
s/\(viewer_users: \)list\[str\]/\1set[str]/g;
102
-
s/\(viewer_groups: \)list\[str\]/\1set[str]/g;
103
-
s/\(admin_roles: \)list\[str\]/\1set[str]/g' \
104
-
pyatlan_v9/model/assets/asset.py
105
-
```
106
-
107
-
**b) related_entity.py** — ensure `relationship_attributes` field exists after `unique_attributes`. If the generated file doesn't have it, add:
98
+
**related_entity.py** — ensure `relationship_attributes` field exists after `unique_attributes`. This file is not generated in sdkOnly mode, so it persists across regens. If starting from scratch, add:
Report: how many files were generated, how many synced, how many excluded, and test results if applicable.
128
124
129
125
## Notes
130
126
131
127
- The models repo is cloned from `git@github.com:atlanhq/models.git`
132
128
- If `../models` already exists, it fetches and checks out the requested branch instead of re-cloning
133
-
- Generated files go to `models/gen_v9/` as a staging area, then are selectively synced
134
-
- The `set[str]` patch is needed because Pkl's `multiValued=true` generates `list[str]` but the SDK semantically needs `set[str]` for user/group/role fields
129
+
-`-p sdkOnly=true` ensures only Python SDK files are generated (no JSON typedefs written to models repo)
130
+
- Generated files go to a temp staging dir, then are selectively synced to `atlan-python/pyatlan_v9/model/assets/`
131
+
- Fields with `useSetType=true` in the Pkl typedefs generate `set[str]` instead of `list[str]` (used for user/group/role fields)
135
132
- Overlay files (custom methods like `creator()`, `updater()`, policy helpers) live at `pyatlan_v9/model/assets/_overlays/` in this repo
0 commit comments