How to use the csvkit.sql.make_column function in csvkit

To help you get started, we’ve selected a few csvkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_big_int(self):
        c = sql.make_column(table.Column(0, 'test', [u'1', u'-87', u'418000000', u'2147483648']))
        self.assertEqual(c.key, 'test')
        self.assertEqual(type(c.type), BigInteger)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_datetime(self):
        c = sql.make_column(table.Column(0, 'test', [u'Jan 1, 2008 at 4:40 AM', u'2010-01-27T03:45:00', u'3/1/08 16:14:45', u'']))
        self.assertEqual(type(c.type), DateTime)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_column_no_nulls(self):
        c = sql.make_column(table.Column(0, 'test', [u'1', u'-87', u'418000000']))
        self.assertEqual(c.key, 'test')
        self.assertEqual(type(c.type), Integer)
        self.assertEqual(c.nullable, False)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_float(self):
        c = sql.make_column(table.Column(0, 'test', [u'1.01', u'-87.34', u'418000000.0', u'']))
        self.assertEqual(type(c.type), Float)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_bool(self):
        c = sql.make_column(table.Column(0, 'test', [u'True', u'True', u'False', u'']))
        self.assertEqual(type(c.type), Boolean)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_string_length(self):
        c = sql.make_column(table.Column(0, 'test', [u'this', u'is', u'test', u'data', u'that', u'is', u'awesome']))
        self.assertEqual(c.type.length, 7)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_string(self):
        c = sql.make_column(table.Column(0, 'test', [u'this', u'is', u'test', u'data']))
        self.assertEqual(type(c.type), String)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_date(self):
        c = sql.make_column(table.Column(0, 'test', [u'Jan 1, 2008', u'2010-01-27', u'3/1/08', u'']))
        self.assertEqual(type(c.type), Date)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_int(self):
        c = sql.make_column(table.Column(0, 'test', [u'1', u'-87', u'418000000', u'']))
        self.assertEqual(c.key, 'test')
        self.assertEqual(type(c.type), Integer)
github wireservice / csvkit / tests / test_sql.py View on Github external
def test_make_column_time(self):
        c = sql.make_column(table.Column(0, 'test', [u'4:40 AM', u'03:45:00', u'16:14:45', u'']))
        self.assertEqual(type(c.type), Time)