Skip to content

fix(apps): send the full existing connection on a miner run (AICHAT-1798) - #1037

Merged
Aryamanz29 merged 3 commits into
mainfrom
aichat-1798-miner-connection-name
Sep 10, 2026
Merged

fix(apps): send the full existing connection on a miner run (AICHAT-1798)#1037
Aryamanz29 merged 3 commits into
mainfrom
aichat-1798-miner-connection-name

Conversation

@Aryamanz29

Copy link
Copy Markdown
Member

What

A pyatlan-created BigQuery/Snowflake/etc. miner that references an existing connection by qualifiedName only was renaming that connection to its qualifiedName's numeric tail (e.g. bigquery-tvf-line-21788198662).

Closes AICHAT-1798.

Root cause

_create() sent a stub connection — qualifiedName + connectorName, no name. atlan-popularity-app derives the connection name from that payload; with the name empty it falls back to connection_qualified_name.rsplit("/")[-1] (the numeric tail) and publish writes it back.

Why only some runs: the UI native run and an SDK update/rerun (load()) send the whole connection (name included) via _loaded_connection, so they were never affected. Only a fresh run() with a QN-only reference hit the stub path.

Fix

A fresh miner run now reads the connection back in full (get_by_qualified_name(..., min_ext_info=False)) and sends the entire object the same way a rerun does — routed through the existing full-send path — so a full-replace downstream drops no attribute (not just name; also category/rowLimit/etc.). The read-back carries the connection's own defaultCredentialGuid, so the credential is still reused with no separate lookup (top-level credential_guid stays "").

If the connection cannot be read and no explicit connection(name=...) was given, it raises CONNECTION_READ_FOR_APP_FAILED (ATLAN-PYTHON-400-081) instead of silently sending a stub that would rename the connection.

Scope & safety

  • Miners only — gated on referencing an existing connection by QN. Crawlers (which mint a new connection by name) and staged-credential paths never trigger it.
  • Serialized via .json() so set-typed attributes are JSON-safe (a .dict() would emit raw sets).
  • Explicit .connection(name=…/admin_*=…) / .credential_guid() still override the read-back.

Tests

tests/unit/test_app_builders.py — full read-back sent; connector derived from QN; explicit-name override; read-failure raises; explicit-name recovers a read failure. 449 passed, 3 skipped, ruff clean.

…798)

A miner references an existing connection by qualifiedName, but _create() sent a
stub carrying only the QN and connectorName — no name. atlan-popularity-app then
derives the connection name from an empty value, falls back to the qualifiedName's
numeric tail, and publish renames the connection to that number. The UI and a
rerun never hit this because they send the whole connection.

_create() now reads the connection back in full (get_by_qualified_name) and sends
the entire object the same way a rerun does, so a full-replace downstream drops no
attributes. The read-back carries the connection's own defaultCredentialGuid, so
the credential is still reused. If the connection cannot be read and no explicit
name was given, it raises CONNECTION_READ_FOR_APP_FAILED rather than silently
sending a stub that would rename the connection.
@linear

linear Bot commented Sep 10, 2026

Copy link
Copy Markdown

AICHAT-1798

…AICHAT-1798)

The read-back used min_ext_info=False, which returns the connection's entire
attribute set — ~89 fields including empty analytics arrays and computed scores
(popularityScore, viewScore, sourceRead*, assetMc*, ...). Echoing those from an
extract step is noise and can clobber real popularity on a full-replace.

Fetch only the config attributes the UI forwards on a miner run (identity,
credential/policy strategy, admins, query settings) via get_by_qualified_name's
attributes= list. The payload now matches the frontend's connection shape (~21
config fields, name included), with no analytics/popularity fields.
…lytics

Add a client-side allowlist filter so no attribute outside _CONNECTION_WIRE_ATTRS
can ride on the payload even if the read returns more, and strengthen the miner
test: it now asserts the read requests only the curated attributes, the config
fields (name/category/rowLimit/admins/connectorName/defaultCredentialGuid) flow
through, and computed analytics on the read-back (popularityScore/viewScore) are
dropped rather than forwarded.
@Aryamanz29
Aryamanz29 merged commit e2c6a40 into main Sep 10, 2026
64 of 77 checks passed
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