Merged
Conversation
izeigerman
reviewed
Aug 11, 2025
sqlmesh_dbt/operations.py
Outdated
| select_models=select_models, | ||
| forward_only=True, | ||
| no_auto_categorization=True, # everything is breaking / foward-only | ||
| effective_from=self.context.config.model_defaults.start, |
Collaborator
There was a problem hiding this comment.
effective_from means something different, let's use start instead or not pass anything at all
izeigerman
reviewed
Aug 11, 2025
sqlmesh_dbt/operations.py
Outdated
|
|
||
| self.context.plan( | ||
| select_models=select_models, | ||
| forward_only=True, |
Collaborator
There was a problem hiding this comment.
I don't think we should not set this explicitly
izeigerman
reviewed
Aug 11, 2025
| progress.update(load_task_id, description="Loading project", total=None) | ||
|
|
||
| # inject default start date if one is not specified to prevent the user from having to do anything | ||
| _inject_default_start_date(project_dir) |
Collaborator
There was a problem hiding this comment.
Instead of doing this I'd suggest extending sqlmesh_config with the start date and hardcode the start date at sqlmesh init time.
Collaborator
Author
There was a problem hiding this comment.
I'll do this in a follow-up PR. To summarize our conversation:
- We dont touch any existing dbt file like
dbt_project.yml - We check for a file called
sqlmesh.yamlin the root of the DBT project - If it exists, we read directives like the start date from it and it generally follows the same format as SQLMesh's existing
config.yamlfile - If it doesn't exist, we do an "automatic init" to create it and stamp the start date as
yesterday_ds()so it can take effect on subsequent invocations
This approach also provides a place to store other configuration in future, such as the virtual data environment mode
izeigerman
reviewed
Aug 11, 2025
tests/dbt/cli/__init__.py
Outdated
| @@ -0,0 +1 @@ | |||
| pytestmark = ["foo"] | |||
Collaborator
Author
There was a problem hiding this comment.
No, it's leftover from when I was experimenting with pytest marks. Will remove it
izeigerman
approved these changes
Aug 11, 2025
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.
Adds a very basic skeleton for creating a CLI that takes input in the form of existing dbt core CLI commands and translates them to the SQLMesh equivalent.
It doesn't do much yet but i've raised this PR to demonstrate the approach i'm thinking and also in the spirit of smaller, more focused PR's vs a big dump.
The goal here is also to provide some initial hooks to help multiple developers build out functionality in parallel.
Key points:
sqlmesh_dbt, with the intention of being able to one day aliasdbt=sqlmesh_dbtand still have things worksqlmeshpackage. This allows it to start outputting to the console immediately and defer loading SQLMesh until later.If you clone the jaffle shop_duckdb project, you can, with zero changes to anything in that project:
(note: I only added this because it was helpful in investigating why selectors weren't matching)
and