Skip to content
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

Revert "Export JSON as a string and add test (#111)" #123

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions tap_mysql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ def schema_for_column(c):
elif data_type in FLOAT_TYPES:
result.type = ['null', 'number']

elif data_type == 'json':
result.type = ['null', 'string']

elif data_type == 'decimal':
result.type = ['null', 'number']
result.multipleOf = 10 ** (0 - c.numeric_scale)
Expand Down
31 changes: 0 additions & 31 deletions tests/test_tap_mysql.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,37 +876,6 @@ def runTest(self):
self.assertTrue(isinstance(record_message, singer.RecordMessage))
self.assertEqual(record_message.record, {'b c': 1})

class TestJsonTables(unittest.TestCase):

def setUp(self):
self.conn = test_utils.get_test_connection()

with connect_with_backoff(self.conn) as open_conn:
with open_conn.cursor() as cursor:
cursor.execute('CREATE TABLE json_table (val json)')
cursor.execute('INSERT INTO json_table (val) VALUES ( \'{"a": 10, "b": "c"}\')')

self.catalog = test_utils.discover_catalog(self.conn, {})
for stream in self.catalog.streams:
stream.key_properties = []

stream.metadata = [
{'breadcrumb': (), 'metadata': {'selected': True, 'database-name': 'tap_mysql_test'}},
{'breadcrumb': ('properties', 'val'), 'metadata': {'selected': True}}
]

stream.stream = stream.table
test_utils.set_replication_method_and_key(stream, 'FULL_TABLE', None)

def runTest(self):
global SINGER_MESSAGES
SINGER_MESSAGES.clear()
tap_mysql.do_sync(self.conn, {}, self.catalog, {})

record_message = list(filter(lambda m: isinstance(m, singer.RecordMessage), SINGER_MESSAGES))[0]
self.assertTrue(isinstance(record_message, singer.RecordMessage))
self.assertEqual(record_message.record, {'val': '{"a": 10, "b": "c"}'})

class TestUnsupportedPK(unittest.TestCase):

def setUp(self):
Expand Down