-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix deprecation warnings (breaking) (#44)
* Migrate to non-deprecated interface in sqlalchemy-redshift * Migrate to non-deprecated interface in google-cloud-bigquery * Remove deprecated dataframe() source factory method args (breaking) * Change deprecated call to assertDictContainsSubset
- Loading branch information
1 parent
a64ea93
commit 9aecda7
Showing
17 changed files
with
386 additions
and
47 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
195 | ||
189 |
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 +1 @@ | ||
89.9900 | ||
90.1100 |
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,42 @@ | ||
import unittest | ||
from records_mover.db.redshift.records_copy import redshift_copy_options | ||
from records_mover.records import DelimitedRecordsFormat | ||
from sqlalchemy_redshift.commands import Encoding | ||
|
||
|
||
class TestRecordsCopy(unittest.TestCase): | ||
def test_redshift_copy_options_bad_compression_roll_with_it(self): | ||
records_format =\ | ||
DelimitedRecordsFormat(variant='bluelabs', | ||
hints={ | ||
'compression': 'somethingnew' | ||
}) | ||
unhandled_hints = set(records_format.hints.keys()) | ||
# This isn't in the Enum...for now. | ||
with self.assertRaises(ValueError): | ||
redshift_copy_options(unhandled_hints, | ||
records_format.hints, | ||
fail_if_cant_handle_hint=False, | ||
fail_if_row_invalid=True, | ||
max_failure_rows=0) | ||
|
||
def test_redshift_copy_options_encodings(self): | ||
tests = { | ||
'UTF16': Encoding.utf16, | ||
'UTF16LE': Encoding.utf16le, | ||
'UTF16BE': Encoding.utf16be | ||
} | ||
for hint_spelling, redshift_sqlalchemy_spelling in tests.items(): | ||
|
||
records_format =\ | ||
DelimitedRecordsFormat(variant='bluelabs', | ||
hints={ | ||
'encoding': hint_spelling | ||
}) | ||
unhandled_hints = set(records_format.hints.keys()) | ||
out = redshift_copy_options(unhandled_hints, | ||
records_format.hints, | ||
fail_if_cant_handle_hint=True, | ||
fail_if_row_invalid=True, | ||
max_failure_rows=0) | ||
self.assertIs(out['encoding'], redshift_sqlalchemy_spelling) |
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
Empty file.
Oops, something went wrong.