Skip to content

feat: no missing external model provides fix#5058

Merged
benfdking merged 1 commit intomainfrom
add_external_columns_action
Jul 29, 2025
Merged

feat: no missing external model provides fix#5058
benfdking merged 1 commit intomainfrom
add_external_columns_action

Conversation

@benfdking
Copy link
Contributor

@benfdking benfdking commented Jul 29, 2025

  • Note that at the moment it does not work when there is no external_models.yaml file. In this case it doesn't suggest the fix.

@benfdking benfdking marked this pull request as draft July 29, 2025 15:07
@benfdking benfdking force-pushed the add_external_columns_action branch 2 times, most recently from bc1653a to c8acb31 Compare July 29, 2025 19:41
@benfdking benfdking requested a review from Copilot July 29, 2025 19:41
@benfdking benfdking marked this pull request as ready for review July 29, 2025 19:41
Copy link
Contributor

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 implements an automatic fix feature for the "no missing external models" linter rule that adds missing external models to the external_models.yaml file. The fix intelligently handles whether the file ends with a newline or not to properly format the YAML addition.

  • Adds automatic fix generation for missing external models in the linter
  • Removes LSP-specific code for external model management (code lenses and commands)
  • Adds comprehensive test coverage for the fix functionality with different file ending scenarios

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
sqlmesh/core/linter/rules/builtin.py Implements create_fix method to automatically add missing external models to YAML file
tests/core/linter/test_builtin.py Adds test cases for fix functionality with files ending/not ending in newlines
sqlmesh/lsp/main.py Removes external model update commands and code lens features
sqlmesh/lsp/context.py Removes LSP-specific external model update functionality

@benfdking benfdking force-pushed the add_external_columns_action branch from c8acb31 to 275a770 Compare July 29, 2025 19:43
@benfdking benfdking force-pushed the add_external_columns_action branch from 275a770 to a7604f9 Compare July 29, 2025 20:01
@benfdking benfdking enabled auto-merge (squash) July 29, 2025 20:01
- nomissingexternalmodels lint rule now returns a fix that can be used
  by the IDE
@benfdking benfdking force-pushed the add_external_columns_action branch from 7a002e9 to e5e0680 Compare July 29, 2025 23:34
@benfdking benfdking merged commit cedaf88 into main Jul 29, 2025
27 checks passed
@benfdking benfdking deleted the add_external_columns_action branch July 29, 2025 23:51
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