Skip to content

FND-3847: add pyatlan_v9 creators for the 3 Cosmos MongoDB types - #1082

Open
cmgrote wants to merge 2 commits into
mainfrom
FND-3847
Open

cmgrote wants to merge 2 commits into
mainfrom
FND-3847

Conversation

@cmgrote

@cmgrote cmgrote commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

✨ Description

Adds creator() for the 3 Cosmos MongoDB asset types in pyatlan_v9: CosmosMongoDBAccount, CosmosMongoDBDatabase, CosmosMongoDBCollection. Both atlan-cosmosdb-app and atlan-cosmosnosql-app emit these types with the same qualifiedName shape, so one creator per type fits both.

CosmosMongoDBCollection.creator(
    name="line_items",
    cosmos_mongo_db_database_qualified_name="default/cosmos/1712345678/accounts/sales-account/databases/orders",
)
# qualified_name == "default/cosmos/1712345678/accounts/sales-account/databases/orders/collections/line_items"
  • Exact app parity: {conn}/accounts/{account}, .../databases/{db}, .../collections/{collection}, the strings both apps emit today (FND-3838 census). A different string would re-key existing assets.
  • Parent relationship and denormalised attributes are set: Database sets cosmosMongoDBAccount + cosmosMongoDBAccountQualifiedName; Collection sets cosmosMongoDBDatabase + cosmosMongoDBDatabaseQualifiedName + databaseName / databaseQualifiedName (inherited from Table, and set by both apps). validate(for_creation=True) passes with no extra checks in the overlay.
  • connection_qualified_name is optional on Database / Collection; when omitted it is the first 3 segments of the parent qualifiedName (a too-short parent QN raises).
  • Blank inputs raise (validate_required_fields).
  • Parent inputs are named after the typedef attributes, like the ADLS creators.
  • Overlays in pyatlan_v9/model/assets/_overlays/cosmos_mongo_db_*.py; the 3 classes are regenerated from atlanhq/models with these overlays (pkl sdkOnly=python + pre-commit, the same steps as sync-python-sdk.yaml).

Linear: FND-3847 — required-attributes analysis table is in the issue comments.
Paired models PR (merge first): https://github.com/atlanhq/models/pull/2081 — adds the matching qualifiedNameFormula, which drives the regenerated _QUALIFIED_NAME_PATTERN.


🧩 Type of change

  • 🚀 New feature (non-breaking change that adds functionality)

✅ How has this been tested?

  • tests_v9/unit/model/cosmos_mongo_db_test.py (26 tests): literal app qualifiedName per type, account → database → collection chaining, relationship + denormalised attributes, name pattern match, validate(for_creation=True), missing / blank / too-short inputs, create and create_for_modification aliases.
  • Mutation check: changing the Collection slug collections → containers fails the parity tests.
  • With the models PR branch, only the 3 Cosmos MongoDB classes change.
  • pytest tests_v9/unit: 7701 passed, 5 skipped. pre-commit clean on all changed files.
  • Not done: a production check that existing Cosmos MongoDB assets all match the stricter patterns (the Cognos PR did one). Both apps' transformers emit exactly these shapes.

🤖 Generated with Claude Code

https://claude.ai/code/session_011uG1w2Vm1KcdbnG1wpbCXc

Adds creator() (plus create / create_for_modification aliases) for
CosmosMongoDBAccount, CosmosMongoDBDatabase and CosmosMongoDBCollection as
hand-written overlays. Each emits the exact qualifiedName that
atlan-cosmosdb-app and atlan-cosmosnosql-app emit today:
{conn}/accounts/{account}/databases/{db}/collections/{collection}.

Database and Collection set the parent relationship and denormalised
attributes (account / database qualifiedNames, databaseName,
databaseQualifiedName), so validate(for_creation=True) passes.
connection_qualified_name is derived from the parent qualifiedName when
omitted.

The 3 classes are regenerated from atlanhq/models#2081, which adds the
matching qualifiedNameFormula.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011uG1w2Vm1KcdbnG1wpbCXc
@linear

linear Bot commented Oct 14, 2026

Copy link
Copy Markdown

FND-3847

# Conflicts:
#	pyatlan_v9/model/assets/cosmos_mongo_db_account.py
#	pyatlan_v9/model/assets/cosmos_mongo_db_collection.py
#	pyatlan_v9/model/assets/cosmos_mongo_db_database.py

This branch has not been deployed

No deployments
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