-
Notifications
You must be signed in to change notification settings - Fork 155
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
Feature/python model v1 #182
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
872bbad
push snowflake implementation refactored from drews code
ChenyuLInx 1797501
add py_materialize_as_table
ChenyuLInx 68c66f7
add load df def
ChenyuLInx 8a6b066
Bump version to 1.3.0a1
jtcohen6 49bb604
make session global so we can load table with dbt ref
ChenyuLInx 1490de2
update requirement for the moment and fix format
ChenyuLInx d61a212
remove logging and add functional test
ChenyuLInx 86e6f11
Misc experimentation
jtcohen6 1cc2158
make snowflake work
ChenyuLInx bc0b241
fix indentation
ChenyuLInx 2f4c113
update materialization macro
ChenyuLInx 2bfddc6
resolve pandas df save and update entry function name
ChenyuLInx 7d2c51b
update python model tests
ChenyuLInx 61a9ff3
adjust for compiled_code syntax
ChenyuLInx 4219827
Merge pull request #3 from dbt-labs/python-model
ChenyuLInx 037ff06
refactor submit python and attampt for incremental
ChenyuLInx 4b88f3f
adjust name
ChenyuLInx 85e34f5
refactor submit and misc expirements
ChenyuLInx c76cc0b
Merge branch 'main' into feature/python-model-v1
ChenyuLInx b0bf163
fix incremental model
ChenyuLInx 6e74ed6
proper tmp table for snowflake incremental model
ChenyuLInx d4fdbcd
add test for incremental model (#197)
ChenyuLInx ec792d5
update python procedure result
ChenyuLInx 3e9518c
Update dbt/adapters/snowflake/impl.py
ChenyuLInx 8f99b3e
fix testing
ChenyuLInx ccccf79
fix format
ChenyuLInx f7d6531
update write_table macro name
ChenyuLInx e450e28
Merge branch 'main' into feature/python-model-v1
ChenyuLInx 86e55ef
adjust to new syntax
ChenyuLInx 68df73f
fix tox
ChenyuLInx 190eafd
Merge branch 'main' into feature/python-model-v1
ChenyuLInx 03c61cc
add comment to run code
ChenyuLInx ed9a6ec
move tests to base and adjust core version
ChenyuLInx 1df614d
add changelog
ChenyuLInx File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
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
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
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
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,43 @@ | ||
import pytest | ||
from dbt.tests.util import run_dbt, write_file | ||
from dbt.tests.adapter.python_model.test_python_model import BasePythonModelTests, BasePythonIncrementalTests | ||
|
||
class TestPythonModelSnowflake(BasePythonModelTests): | ||
pass | ||
|
||
class TestIncrementalSnowflake(BasePythonIncrementalTests): | ||
pass | ||
|
||
models__simple_python_model = """ | ||
import pandas | ||
|
||
def model(dbt, session): | ||
dbt.config( | ||
materialized='table', | ||
) | ||
data = [[1,2]] * 10 | ||
return pandas.DataFrame(data, columns=['test', 'test2']) | ||
""" | ||
models__simple_python_model_v2 = """ | ||
import pandas | ||
|
||
def model(dbt, session): | ||
dbt.config( | ||
materialized='table', | ||
) | ||
data = [[1,2]] * 10 | ||
return pandas.DataFrame(data, columns=['test1', 'test3']) | ||
ChenyuLInx marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
|
||
|
||
|
||
class TestChangingSchemaSnowflake: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return { | ||
"simple_python_model.py": models__simple_python_model | ||
} | ||
def test_changing_schema(self,project): | ||
run_dbt(["run"]) | ||
write_file(models__simple_python_model_v2, project.project_root + '/models', "simple_python_model.py") | ||
run_dbt(["run"]) |
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
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.
What the model code looks like, we are enforcing session here because it is local to the function and certain operations depends on it