Skip to content

fix!: correctly identify keys to make deterministic#4984

Merged
eakmanrq merged 2 commits intomainfrom
eakman/more_specific_deterministic_dicts
Jul 17, 2025
Merged

fix!: correctly identify keys to make deterministic#4984
eakmanrq merged 2 commits intomainfrom
eakman/more_specific_deterministic_dicts

Conversation

@eakmanrq
Copy link
Collaborator

@eakmanrq eakmanrq commented Jul 17, 2025

Fixing a mistake in this PR: #4925

The issue is that the user could have defined a variable in the global namespace and this PR would sort the dictionary which would cause an issue for the user if they rely on the dictionary order. Therefore this PR makes the sorting logic focused just on the known dictionaries that we control: sqlmesh vars and sqlmesh blueprint vars. It also changes the sorting to only sort on the root level dict instead of doing a recursive sort. This is because a user could define a dict as a value in variable/blueprint variables and we don't want to change that.

The previous 85 migration is updated to do the correct thing. 86 migration was added to try to detect if the user may have been impacted by this bug and if so it will log a warning.

@eakmanrq eakmanrq force-pushed the eakman/more_specific_deterministic_dicts branch from 5d8b68d to a355552 Compare July 17, 2025 19:36
@eakmanrq eakmanrq marked this pull request as ready for review July 17, 2025 19:36
@eakmanrq eakmanrq force-pushed the eakman/more_specific_deterministic_dicts branch from a355552 to 60ee5ee Compare July 17, 2025 20:00
@crericha
Copy link
Contributor

Will this mean user dicts are still non-deterministic from plan to plan?

@eakmanrq eakmanrq force-pushed the eakman/more_specific_deterministic_dicts branch 2 times, most recently from bbdc69d to d2d10be Compare July 17, 2025 20:44
@eakmanrq
Copy link
Collaborator Author

Will this mean user dicts are still non-deterministic from plan to plan?

Yes I have basically changed the implementation to be as conservative as possible. If we see an issue with this in the future we can expand to include them.

@eakmanrq eakmanrq force-pushed the eakman/more_specific_deterministic_dicts branch from d2d10be to 4b53296 Compare July 17, 2025 20:48
@eakmanrq eakmanrq merged commit a274ac7 into main Jul 17, 2025
26 of 27 checks passed
@eakmanrq eakmanrq deleted the eakman/more_specific_deterministic_dicts branch July 17, 2025 21:02
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