Skip to content

refactor(core): remove unreachable null guards in Attribute.equals - #8267

Open
Alwaysgaurav1 wants to merge 3 commits into
apache:mainfrom
Alwaysgaurav1:fix-attribute-equals-guards
Open

refactor(core): remove unreachable null guards in Attribute.equals#8267
Alwaysgaurav1 wants to merge 3 commits into
apache:mainfrom
Alwaysgaurav1:fix-attribute-equals-guards

Conversation

@Alwaysgaurav1

@Alwaysgaurav1 Alwaysgaurav1 commented Aug 31, 2026

Copy link
Copy Markdown

What changes were proposed in this PR?

In Attribute.java (common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java), Attribute.equals() contained redundant/unreachable null guards:

if (this.attributeName == null) {
    return that.attributeName == null;
}
if (this.attributeType == null) {
    return that.attributeType == null;
}

…equals

Remove unreachable null checks on this.attributeName and this.attributeType in Attribute.equals(), since the constructor enforces non-null for both fields via checkNotNull. This also removes the latent bug in the second guard where attributeName was ignored during comparison.

Closes apache#8149
@Yicong-Huang Yicong-Huang added the release/v1.2 back porting to release/v1.2 label Aug 31, 2026
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for your first contribution to Texera, @Alwaysgaurav1!

If you're looking for a good place to start, browse issues labeled starter-task; they're scoped to be approachable for newcomers.

You can drive common housekeeping yourself by commenting one of these commands on its own line:

  • Issues. Comment /take to assign an open issue to yourself, or /untake to release it. You can find unclaimed work with the search filter is:issue is:open no:assignee.
  • Sub-issues. To link issues into a parent/child hierarchy, comment /sub-issue #5166 #5222 on the parent to attach those children (or /unsub-issue #5166 #5222 to detach them). From a child issue, comment /parent-issue #5166 to set its parent, or /unparent-issue to clear it (the current parent is detected automatically). References may be written as #5166 or as a bare 5166; cross-repository references are not supported.
  • Pull requests (author only). Comment /request-review @user to request a review from someone, or /unrequest-review @user to withdraw that request.

Each command must match exactly: /take this will not work, only /take does. For the full contribution flow, see CONTRIBUTING.md.

@github-actions
github-actions Bot requested a review from xuang7 August 31, 2026 06:13
@github-actions

Copy link
Copy Markdown
Contributor

👋 Thanks for opening this pull request, @Alwaysgaurav1!

It looks like the pull request description doesn't quite follow our template yet:

  • The How was this PR tested? section is missing; please keep the template's headings.
  • The Was this PR authored or co-authored using generative AI tooling? section is missing; please keep the template's headings.

Filling out the template helps reviewers understand and triage your contribution faster. Please edit the description to complete it. This message will disappear automatically once the template is followed.

You can find the template prompts by editing the description, or see CONTRIBUTING.md for the full contribution flow.

@github-actions

Copy link
Copy Markdown
Contributor

Backport auto-label report

This fix: PR was checked against each actively-supported release branch. release/* labels drive the post-merge backport, so add or remove one to change where this fix lands.

Release branch Analysis
⚠️ release/v1.3 Not labeled automatically — none of the files this PR modifies exist on this branch (common/workflow-core/src/main/scala/org/apache/texera/amber/core/tuple/Attribute.java). The fix may target code that isn't on this release, or the files were moved/renamed after the branch was cut. Please check and add release/v1.3 by hand if this fix should be backported here.
release/v1.2 Change detected on this branch — label added; this fix is queued to backport here. Requested review from @xuang7.

Auto-label run.

@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @carloea2
    You can notify them by mentioning @carloea2 in a comment.

@xuang7 xuang7 removed fix release/v1.2 back porting to release/v1.2 labels Sep 13, 2026
@xuang7

xuang7 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR. Please follow the pull request template. Also, since this is not a bug fix, you may want to rename the PR title to use refactor. Temporarily marked it as a draft. Please feel free to mark it as ready for review once the PR is ready.

@xuang7
xuang7 marked this pull request as draft September 13, 2026 01:15
@Alwaysgaurav1 Alwaysgaurav1 changed the title fix(core): remove unreachable and bug-prone null guards in Attribute.equals refactor(core): remove unreachable null guards in Attribute.equals Sep 13, 2026
@Alwaysgaurav1
Alwaysgaurav1 marked this pull request as ready for review September 13, 2026 08:03
@github-actions github-actions Bot added the fix label Sep 13, 2026
@Alwaysgaurav1

Copy link
Copy Markdown
Author

Thanks for the guidance, @xuang7
I've updated the PR title to refactor(core): ..., filled out all sections of the pull request template, and marked the PR as ready for review.

@xuang7

xuang7 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Thanks for the guidance, @xuang7 I've updated the PR title to refactor(core): ..., filled out all sections of the pull request template, and marked the PR as ready for review.

The description is still incomplete. You may refer to other PRs as examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants