-
Notifications
You must be signed in to change notification settings - Fork 229
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
0.15.0 upgrade #46
Merged
Merged
0.15.0 upgrade #46
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
e2f5cb5
upgrade to version 0.15.0
02809a3
exclude build and dist folders
601a840
include drop_schema macro
beb2b91
separate spark__load_csv_rows macro into seed.sql file
a32e29c
ignore dbt-integration-tests
7e62f13
support for extracting statistics
4f60031
fixes for full-refresh
3c93fa5
ensure relation type is set for views and tables
87590de
updated connection keys to include cluster when logging
7ed8129
change comment to Optional[str]
ebee137
implement quoting on columns
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 |
---|---|---|
|
@@ -3,3 +3,7 @@ env/ | |
*.pyc | ||
__pycache__ | ||
.tox/ | ||
.idea/ | ||
build/ | ||
dist/ | ||
dbt-integration-tests |
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,41 @@ | ||
from dataclasses import dataclass | ||
from typing import TypeVar | ||
|
||
from dbt.adapters.base.column import Column | ||
|
||
Self = TypeVar('Self', bound='SparkColumn') | ||
|
||
|
||
@dataclass(init=False) | ||
class SparkColumn(Column): | ||
column: str | ||
dtype: str | ||
comment: str | ||
|
||
def __init__( | ||
self, | ||
column: str, | ||
dtype: str, | ||
comment: str = None | ||
) -> None: | ||
super().__init__(column, dtype) | ||
|
||
self.comment = comment | ||
|
||
@classmethod | ||
def translate_type(cls, dtype: str) -> str: | ||
return dtype | ||
|
||
def can_expand_to(self: Self, other_column: Self) -> bool: | ||
"""returns True if both columns are strings""" | ||
return self.is_string() and other_column.is_string() | ||
|
||
def literal(self, value): | ||
return "cast({} as {})".format(value, self.dtype) | ||
|
||
@property | ||
def data_type(self) -> str: | ||
return self.dtype | ||
|
||
def __repr__(self) -> str: | ||
return "<SparkColumn {} ({})>".format(self.name, self.data_type) |
Oops, something went wrong.
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.
If comments can be None, instead just do:
That will add
comment
as a new optional str field, which is what it is based on this argument spec.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.
Perfect, thanks.