Skip to content

clone dims before changing #7740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

clone dims before changing #7740

wants to merge 1 commit into from

Conversation

pjain1
Copy link
Member

@pjain1 pjain1 commented Aug 6, 2025

Dim fields slices are shared between ast and select nodes, so clone the slice before making modifications.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@pjain1 pjain1 marked this pull request as draft August 6, 2025 18:45
@pjain1 pjain1 requested a review from Copilot August 6, 2025 19:00
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a slice mutation issue where dimension fields and order by fields are shared between AST and select nodes. The changes ensure that slices are cloned before making modifications to prevent unintended side effects on shared data structures.

  • Clones dimension field slices before modifying field names and expressions
  • Clones order by field slices before modifying field names
  • Replaces direct slice mutations with operations on cloned slices

@pjain1 pjain1 requested a review from begelundmuller August 7, 2025 05:04
@pjain1 pjain1 marked this pull request as ready for review August 7, 2025 05:04
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