-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix whitespace issue with incremental sql #458
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a3c6a31
fix whitespace issue with incremental sql
colin-rogers-dbt 546c501
add changie
colin-rogers-dbt 66e3e77
add setuptools install
colin-rogers-dbt 3e6f941
add twine and check-wheel-contents
colin-rogers-dbt 73988f7
try installing pkgconfig-lite
colin-rogers-dbt 5b63ac5
add --allow-empty-checksums
colin-rogers-dbt a4a3ce7
check pkg-config installs
colin-rogers-dbt d51fe14
install mac os pyicu dependencies
colin-rogers-dbt db8c4f3
fix syntax issue
colin-rogers-dbt d27cf24
force agate 1.6.3
colin-rogers-dbt 52de0f0
add trailing comma
colin-rogers-dbt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
kind: Fixes | ||
body: stop eliminating trailing whitespace in incremental merge sql | ||
time: 2023-01-09T10:53:25.837837-08:00 | ||
custom: | ||
Author: colin-rogers-dbt | ||
Issue: "457" | ||
PR: "458" |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
{{ wrap_with_time_ingestion_partitioning_sql(build_partition_time_exp(partition_by), sql, True) }} | ||
{%- else -%} | ||
{{sql}} | ||
{%- endif -%} | ||
{%- endif %} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FTW! |
||
) | ||
{%- endif -%} | ||
{%- endset -%} | ||
|
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import pytest | ||
import os | ||
from dbt.tests.util import ( | ||
run_dbt | ||
) | ||
|
||
# This is a short term hack, we need to go back | ||
# and make adapter implementations of: | ||
# https://github.com/dbt-labs/dbt-core/pull/6330 | ||
|
||
_INCREMENTAL_MODEL = """ | ||
{{ | ||
config( | ||
materialized="incremental", | ||
) | ||
}} | ||
|
||
{% if not is_incremental() %} | ||
|
||
select 10 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour union all | ||
select 30 as id, cast('2020-01-01 02:00:00' as datetime) as date_hour | ||
|
||
{% else %} | ||
|
||
select 20 as id, cast('2020-01-01 01:00:00' as datetime) as date_hour union all | ||
select 40 as id, cast('2020-01-01 02:00:00' as datetime) as date_hour | ||
|
||
{% endif %} | ||
-- Test Comment To Prevent Reccurence of https://github.com/dbt-labs/dbt-core/issues/6485 | ||
dbeatty10 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
|
||
class BaseIncrementalModelConfig: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"test_incremental.sql": _INCREMENTAL_MODEL | ||
} | ||
|
||
class TestIncrementalModel(BaseIncrementalModelConfig): | ||
def test_incremental_model_succeeds(self, project): | ||
results = run_dbt(["run"]) | ||
assert len(results) == 1 | ||
results = run_dbt(["run"]) | ||
assert len(results) == 1 |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did adding the following turn out to be necessary?
If they aren't strictly necessary, I'd advocate for peeling them out.