fix:[SNOW-3444080] Preserve customer's original key order inside profiles.yml and env.yml; Refactor some code#3130
Draft
sfc-gh-yuding wants to merge 1 commit into
Draft
fix:[SNOW-3444080] Preserve customer's original key order inside profiles.yml and env.yml; Refactor some code#3130sfc-gh-yuding wants to merge 1 commit into
sfc-gh-yuding wants to merge 1 commit into
Conversation
c69aa0e to
6718bfd
Compare
…staging - Extract repeated singular/plural logic into _plural(count, word) helper to avoid repeating the ternary three times (per PR #3125 review comment) - Pass sort_keys=False to yaml.safe_dump in _prepare_profiles_file and _write_env_file so staged files preserve the customer's original key order instead of sorting alphabetically Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
6718bfd to
c7792dc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-review checklist
No user-facing interface change
RELEASE-NOTES.md(see when and how).Updated
RELEASE-NOTES.mdfor profiles.yml changes. As for env.yaml, it's a prpr change, will include it in theRELEASE-NOTES.mdwhen it becomes GANo behavior change
Changes description
Verified on QA6 (
DEXQA6) using thefix/dbt-yaml-staging-fixesbranch.Test files
profiles.yml— keys in a deliberately non-alphabetical order(
type → threads → account → user → password → role → warehouse → database → schema).Alphabetical order would be
account < database < password < role < schema < threads < type < user < warehouse.env.yml— DBT_* keys in reverse-alphabetical order (ZETA → GAMMA → ALPHA → BETA).Alphabetical order would be
ALPHA < BETA < GAMMA < ZETA.Deploy
Verify staged file contents
Staged
profiles.ymlKey order matches the input (
typebeforeaccount,threadsbeforedatabase). ✅Staged
env.ymlKey order matches the input (
ZETA → GAMMA → ALPHA → BETA, not sorted). ✅