Skip to content

feat(models): sync pyatlan_v9 models from models@BLDX-1206 + fix 4 collection errors [BLDX-1206]#920

Merged
Aryamanz29 merged 5 commits into
mainfrom
sync-models-BLDX-1206
Apr 30, 2026
Merged

feat(models): sync pyatlan_v9 models from models@BLDX-1206 + fix 4 collection errors [BLDX-1206]#920
Aryamanz29 merged 5 commits into
mainfrom
sync-models-BLDX-1206

Conversation

@Aryamanz29
Copy link
Copy Markdown
Member

Summary

  • Syncs all regenerated pyatlan_v9 models from atlanhq/models@BLDX-1206
  • Adds 6 new UnstructuredV2 Python model files (BigID / PART-718)
  • Fixes 4 pre-existing test collection errors that blocked the full test suite from running

New UnstructuredV2 models

  • unstructured_v2.py, unstructured_v2_container.py, unstructured_v2_folder.py
  • unstructured_v2_object.py, unstructured_v2_related.py, _init_unstructured_v2.py

Bug fixes (survive regeneration)

Fix Location Root cause
semantic field on Entity entity.py (+ renderer fix in models) ref_by_guid/ref_by_qualified_name passed semantic= but Entity Struct had no such field
Referenceable.STATUS referenceable.py deferred section Marked # DEFERRED but never activated; Asset.STATUS.in_lineage returned None
DataContract.creator data_contract.py + overlay Called non-existent DataContract.Attributes.creator() — inlined logic directly
DataContractAttributes type hint tests_v9/unit/model/data_contract_test.py Test used old nested-class pattern DataContract.Attributes; updated to top-level class

Test Results

  • Before: 4 collection errors, 0 of 3515 tests ran
  • After: 0 collection errors, 3728 passed, 63 pre-existing failures (all present on main before this PR)

Test Plan

  • python -m pytest tests_v9/unit --tb=no -q — expect 3728 passed, 63 pre-existing failures
  • No new failures vs main baseline

🤖 Generated with Claude Code

Aryamanz29 and others added 2 commits April 30, 2026 17:02
…LDX-1206]

Generated pyatlan_v9 Python models from the BLDX-1206 models branch,
which includes UnstructuredV2 asset types (folder, container, object)
sourced from the bigid branch (PART-718).

New files:
- unstructured_v2.py, unstructured_v2_container.py, unstructured_v2_folder.py
- unstructured_v2_object.py, unstructured_v2_related.py, _init_unstructured_v2.py

Also includes model updates for new typedef additions on master since
BLDX-930 base (agentic, artifact, context, gcp_dataplex, skill, skill_artifact).

Note: Knowledge.pkl skipped due to pre-existing getTypeNameFromMapping bug on master.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…[BLDX-1206]

Regenerated all pyatlan_v9 models from atlanhq/models@BLDX-1206 (UnstructuredV2
typedefs from bigid branch) using corrected pkl flags (sdkOnly=true).

Bug fixes that survive regeneration:
- entity.py: add semantic field (SaveSemantic) — enables ref_by_guid/ref_by_qualified_name
- referenceable.py: activate Referenceable.STATUS = InternalKeywordField(...)
- data_contract.py: inline creator logic (remove DataContract.Attributes.creator() call)
- tests: update DataContractAttributes usage (no nested Attributes class in v9)

New UnstructuredV2 assets: unstructured_v2.py, unstructured_v2_container.py,
unstructured_v2_folder.py, unstructured_v2_object.py, unstructured_v2_related.py

Knowledge.pkl skipped (pre-existing getTypeNameFromMapping bug on master).

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Comment thread pyatlan_v9/model/assets/_overlays/data_contract.py
Comment thread pyatlan_v9/model/assets/referenceable.py Outdated
Comment thread pyatlan_v9/model/assets/entity.py
Aryamanz29 and others added 2 commits April 30, 2026 17:59
**Referenceable deferred fields** (GUID, TYPE_NAME, CREATE_TIME, etc.)
- Added missing InternalKeywordField/TextField/InternalNumericField assignments
  so Asset.GUID.order(), Asset.TYPE_NAME.eq() etc. work for search

**Glossary meanings duplicate kwarg**
- Filtered meanings from merged_rels in _atlas_glossary_from_nested to avoid
  double-passing since it's already an explicit kwarg

**QuickSight field renames**
- quick_sight_import_mode → quick_sight_dataset_import_mode
- quick_sight_type → quick_sight_dataset_field_type / quick_sight_folder_type
- quick_sight_column_count → quick_sight_dataset_column_count

**Schema field alias**
- Added schema_external_location property → sql_external_location

**Anchor in attributes for AtlasGlossaryTerm**
- Moved anchor to AtlasGlossaryTermAttributes (not RelationshipAttributes)
- Removed anchor from _ATLAS_GLOSSARY_TERM_REL_FIELDS

**AtlasClassification fields for tag translation**
- Added type_name: Union[Any] to accept AtlanTagName objects post-translation
- Added source_tag_attachments, tag_id, restrict_propagation_through_* fields
- Fixed ReferenceableNested.classifications to decode as List[AtlasClassification]

**Entity.depth field**
- Added depth: Union[int, UnsetType] for lineage list responses
- Also added to PythonMsgspecRenderer.pkl (survives regeneration)

**Translators sourceTagAttachments**
- Always emit sourceTagAttachments: [] when attr_id found (even if no attachments)
  so the field is consistently present for recognized source tags

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
All fixes are now in the Pkl renderer or overlays — they survive regeneration.

**Renderer changes (PythonMsgspecRenderer.pkl):**
- AtlasClassification: type_name→Any, add source_tag_attachments/tag_id/restrict_propagation_* fields
- Entity: add depth (lineage), semantic (SaveSemantic) fields
- Referenceable deferred section: activate STATUS, GUID, TYPE_NAME, CREATED_BY, UPDATED_BY,
  ATLAN_TAGS, PROPAGATED_ATLAN_TAGS, ASSIGNED_TERMS, SUPER_TYPE_NAMES, CREATE_TIME,
  UPDATE_TIME, CUSTOM_ATTRIBUTES from InternalKeywordField/InternalKeywordTextField/InternalNumericField
- ReferenceableNested.classifications: Union[List[AtlasClassification]] (enables proper decode)
- renderFromNestedFunction: skip nestedTopLevelFields already in relAttrs (prevents 'meanings' dupe)
- renderAssetType: implement regularizeRelationships (anchor goes to attributes not rel_attrs)

**Overlay changes:**
- schema.py: add schema_external_location property → sql_external_location
- quick_sight_folder.py: correct field name quick_sight_type
- atlas_glossary_category.py / atlas_glossary.py: handled by renderer fix for meanings

**Non-generated file fixes:**
- translators.py / aio/translators.py: _CLASSIFICATION_NAMES produce str not AtlanTagName
  (purposeClassifications stays as str; purpose_atlan_tags property wraps them when accessed)
- translators.py / aio/translators.py: always emit sourceTagAttachments=[] for recognized source tags

**Test updates:**
- quick_sight_folder_test.py: quick_sight_folder_type → quick_sight_type (generated name)
- quick_sight_dataset_test.py: quick_sight_dataset_import_mode → quick_sight_import_mode
- quick_sight_dataset_field_test.py: quick_sight_dataset_field_type → quick_sight_type

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@Aryamanz29
Copy link
Copy Markdown
Member Author

✅ All tests passing after final regeneration

3761 passed, 0 failed — verified by running pkl eval on all typedefs from models@BLDX-1206, then pre-commit run --all-files, then pytest tests_v9/unit.

All 63 pre-existing failures are now fixed and survive regeneration (fixes live in the Pkl renderer or overlays, not the generated files).

Key renderer fixes that make everything work correctly post-regen:

  • regularizeRelationships implemented: anchor on AtlasGlossaryTerm now goes into attributes (not relationshipAttributes)
  • ReferenceableNested.classifications types as List[AtlasClassification] for correct deserialization
  • All DEFERRED Referenceable field descriptors activated (GUID, STATUS, TYPE_NAME, CREATE_TIME, etc.)
  • renderFromNestedFunction skips entity-level fields that are also rel attrs (prevents meanings duplicate kwarg)

See atlanhq/models#1960 for the companion renderer PR.

Comment thread pyatlan_v9/model/assets/referenceable.py
Comment thread pyatlan_v9/model/assets/_overlays/data_contract.py
Comment thread pyatlan_v9/model/aio/translators.py
Comment thread pyatlan_v9/model/assets/entity.py
Comment thread tests_v9/unit/model/data_contract_test.py
@claude
Copy link
Copy Markdown

claude Bot commented Apr 30, 2026

Review Complete

Verdict: ✅ Approve

This PR successfully syncs regenerated pyatlan_v9 models and fixes 4 test collection errors. See inline comments for detailed feedback.

Security Review Passed - No API keys/tokens in logs, no verify=False, no base_url issues.

CI Status - All v9 QA checks and unit tests passing (3.9-3.13), vulnerability scans passing.

One minor note: Duplicate field descriptors in referenceable.py (harmless, see inline comment).

Good work on the model sync!

@Aryamanz29 Aryamanz29 added run_pyatlan_v9_integration_test To trigger pyatlan v9 (msgspec-based) integration tests suite and removed do not merge labels Apr 30, 2026
…ks clean [BLDX-1206]

After restoring validate/minimize/relate methods in renderer and fixing the
ModelRenderer.getTypeNameFromMapping bug:

- Knowledge.pkl now generates correctly (knowledge_file.py exists)
- useLocalTypeAsPrefix=true now works → QuickSight/Schema field names use proper prefixes
  (quick_sight_folder_type, quick_sight_dataset_import_mode, schema_external_location)
- All asset classes get validate(), minimize(), relate() methods generated
- Tests reverted to use original (correct) field names that the typedefs always
  intended

QuickSight/Schema overlay parameter names updated to match generated field names.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@Aryamanz29 Aryamanz29 force-pushed the sync-models-BLDX-1206 branch from fe9e9a1 to 66f1a40 Compare April 30, 2026 17:54
@Aryamanz29 Aryamanz29 merged commit 24b58c3 into main Apr 30, 2026
28 checks passed
@Aryamanz29 Aryamanz29 deleted the sync-models-BLDX-1206 branch April 30, 2026 17:56
@Aryamanz29 Aryamanz29 restored the sync-models-BLDX-1206 branch April 30, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run_pyatlan_v9_integration_test To trigger pyatlan v9 (msgspec-based) integration tests suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants