Skip to content

When renaming files, log relative file path (not just name) to stdout#359

Open
davidharting wants to merge 16 commits intomainfrom
davidharting/350/stdout-relative-file-path
Open

When renaming files, log relative file path (not just name) to stdout#359
davidharting wants to merge 16 commits intomainfrom
davidharting/350/stdout-relative-file-path

Conversation

@davidharting
Copy link
Collaborator

Description

Follow up to #358. Update logs for ResourceNamesWithSpacesDeprecation to file paths (relative to dbt project) instead of just file names.

Note

The commit history looks funny in GitHub because this was originally stacked on top of #358. But the diff looks right. I will squash and merge anyhow.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • Ran uv run ruff check . --config pyproject.toml
  • Ran uv run ruff format --config pyproject.toml
  • If this is a bug fix:
    • Updated integration tests with bug repro
    • Linked to bug report ticket
  • Added unit tests if needed
  • Updated unit tests if needed
  • Tests passed when run locally

davidharting and others added 11 commits March 17, 2026 09:57
- Add current_file_path to PythonContent (mirrors SQLContent)
- Add optional refactored_file_path to PythonRuleRefactorResult (mirrors SQLRuleRefactorResult)
- Add required refactored_file_path to PythonRefactorResult, update apply_changeset and update_python_file to handle renames (mirrors SQLRefactorResult)
- Update _py() test helper to accept a path arg with default
- Initialize refactored_file_path=python_file in process_python_files()

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirrors rename_sql_file_names_with_spaces: replaces spaces with underscores
in Python model filenames and logs a ResourceNamesWithSpacesDeprecation entry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Mirrors the SQL pattern: behavior_change_rules run first (rename),
followed by safe_change_rules (config-to-meta, config.get-to-meta_get).
Rule selection respects --behavior-change / --all flags.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Input: 'model with spaces.py', expected output: 'model_with_spaces.py'.
Adds the ResourceNamesWithSpacesDeprecation log entry to expected stdout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
'model with spaces.py' → 'python model with spaces.py' (and expected
'python_model_with_spaces.py') to avoid ambiguity with the existing SQL
fixture of the same base name. Also adds both models to schema.yml so the
YAML changeset renames them too.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davidharting davidharting requested a review from aiguofer March 17, 2026 15:57
@davidharting davidharting requested a review from chayac as a code owner March 17, 2026 15:57
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@davidharting davidharting changed the title Davidharting/350/stdout relative file path When renaming files, log relative file path (not just name) to stdout Mar 17, 2026
davidharting and others added 4 commits March 17, 2026 12:01
Previously compare_json_logs only checked actual ⊆ expected, so extra
entries in the expected file would not cause a test failure.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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