Skip to content

Conversation

@sriram-atlan
Copy link

@sriram-atlan sriram-atlan commented Oct 31, 2025

Change description

Work to get ES Read aligned on classification attributes.
Tested locally with ENTITY_CREATE

			"internalAttributes": {
				"__classificationNames": "|LcKITwlaBnUKBdJmlw3fLI|",
				"__version": 0,
				"__hasLineage": false,
				"__u_qualifiedName": "ANALYTICS_43",
				"__classificationsText": "LcKITwlaBnUKBdJmlw3fLI ",
				"__traitNames": [
					"LcKITwlaBnUKBdJmlw3fLI"
				],
				"__guid": "67b8e6cb-8395-457a-9202-4dd343b004de"
			}

null safe approach implementation

Type of change

  • Bug fix (fixes an issue)
  • New feature (adds functionality)

Related issues

https://atlanhq.atlassian.net/browse/MLH-1523

Fix #1

Helm Config Changes for Running Tests (Staging PR)

Does this PR require Helm config changes for testing?

  • Tests are NOT required for this commit. (You can proceed with the PR.) ✅
  • No, Helm config changes are not needed. (You can proceed with the PR.) ✅
  • Yes, I have already updated the config-values on enpla9up36. (You can proceed with the PR.) ✅
  • Yes, but I have NOT updated the config-values. (Please update them before proceeding; or, tests will run with default values.)⚠️

Checklists

Development

  • Lint rules pass locally
  • Application changes have been tested thoroughly
  • Automated tests covering modified code pass

Security

  • Security impact of change has been considered
  • Code follows company security practices and guidelines

Code review

  • Pull request has a descriptive title and context useful to a reviewer. Screenshots or screencasts are attached as necessary
  • "Ready for review" label attached and reviewers assigned
  • Changes have been reviewed by at least one other contributor
  • Pull request linked to task tracker where applicable

Note

Populates internalAttributes in entity notification headers with classification attributes from ES deferred operations matched via decoded docId.

  • Notifications (ES isolation):
    • Enhance toNotificationHeader(...) in EntityNotificationListenerV2 to merge classification-related internal attributes from RequestContext#getESDeferredOperations() into ret.internalAttributes, matching by vertex id decoded from entity.getDocId().
  • Imports:
    • Add ESDeferredOperation and LongEncoding to support deferred ops access and vertex id decoding.

Written by Cursor Bugbot for commit a0ba5f0. This will update automatically on new commits. Configure here.

for (ESDeferredOperation esDeferredOperation : esDefferredOperations) {
Long vertexId = LongEncoding.decode(entity.getDocId());
if (Long.parseLong(esDeferredOperation.getEntityId()) == vertexId) {
Map<String, Object> classificationInternalAttributes = esDeferredOperation.getPayload().get(String.valueOf(vertexId));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Bug

The LongEncoding.decode(entity.getDocId()) call is repeatedly executed inside the loop, which is redundant as entity.getDocId() is constant for the current entity. This also introduces potential NullPointerExceptions if entity.getDocId(), esDeferredOperation.getEntityId(), or esDeferredOperation.getPayload() are null, leading to runtime failures.

Fix in Cursor Fix in Web

@sriram-atlan sriram-atlan merged commit dd500e8 into master Oct 31, 2025
12 of 13 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.

3 participants