forked from sqlalchemy-redshift/sqlalchemy-redshift
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SQLAlchemy v1.4.x support (sqlalchemy-redshift#221)
- Loading branch information
Showing
9 changed files
with
116 additions
and
54 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
0.8.3 (unreleased) | ||
------------------ | ||
|
||
- Nothing changed yet. | ||
- SQLAlchemy 1.4.x support | ||
|
||
|
||
0.8.2 (2021-01-08) | ||
|
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 |
---|---|---|
@@ -1,24 +1,45 @@ | ||
from unittest import TestCase | ||
|
||
from packaging.version import Version | ||
import sqlalchemy as sa | ||
from sqlalchemy.types import NullType, VARCHAR | ||
|
||
from sqlalchemy_redshift.dialect import RedshiftDialect | ||
|
||
sa_version = Version(sa.__version__) | ||
|
||
|
||
class TestColumnReflection(TestCase): | ||
def test_varchar_as_nulltype(self): | ||
""" | ||
Varchar columns with no length should be considered NullType columns | ||
""" | ||
dialect = RedshiftDialect() | ||
column_info = dialect._get_column_info( | ||
'Null Column', | ||
'character varying', None, False, {}, {}, 'default', 'test column' | ||
|
||
null_info = dialect._get_column_info( | ||
name='Null Column', | ||
format_type='character varying', | ||
default=None, | ||
notnull=False, | ||
domains={}, | ||
enums=[], | ||
schema='default', | ||
encode='', | ||
comment='test column', | ||
identity=None | ||
) | ||
assert isinstance(column_info['type'], NullType) | ||
column_info_1 = dialect._get_column_info( | ||
'character column', | ||
'character varying(30)', None, False, {}, {}, 'default', | ||
comment='test column' | ||
assert isinstance(null_info['type'], NullType) | ||
|
||
varchar_info = dialect._get_column_info( | ||
name='character column', | ||
format_type='character varying(30)', | ||
default=None, | ||
notnull=False, | ||
domains={}, | ||
enums=[], | ||
schema='default', | ||
encode='', | ||
comment='test column', | ||
identity=None | ||
) | ||
assert isinstance(column_info_1['type'], VARCHAR) | ||
assert isinstance(varchar_info['type'], VARCHAR) |
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