Python pandas.io.sql.SQLiteDatabase() Examples

The following are 10 code examples of pandas.io.sql.SQLiteDatabase(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pandas.io.sql , or try the search function .
Example #1
Source File: test_sql.py    From recruit with Apache License 2.0 5 votes vote down vote up
def test_sqlite_type_mapping(self):

        # Test Timestamp objects (no datetime64 because of timezone) (GH9085)
        df = DataFrame({'time': to_datetime(['201412120154', '201412110254'],
                                            utc=True)})
        db = sql.SQLiteDatabase(self.conn)
        table = sql.SQLiteTable("test_type", db, frame=df)
        schema = table.sql_schema()
        assert self._get_sqlite_column_type(schema, 'time') == "TIMESTAMP"


# -----------------------------------------------------------------------------
# -- Database flavor specific tests 
Example #2
Source File: test_sql.py    From recruit with Apache License 2.0 5 votes vote down vote up
def load_test_data_and_sql(self):
        self.pandasSQL = sql.SQLiteDatabase(self.conn)
        self._load_test1_data() 
Example #3
Source File: test_sql.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def test_sqlite_type_mapping(self):

        # Test Timestamp objects (no datetime64 because of timezone) (GH9085)
        df = DataFrame({'time': to_datetime(['201412120154', '201412110254'],
                                            utc=True)})
        db = sql.SQLiteDatabase(self.conn)
        table = sql.SQLiteTable("test_type", db, frame=df)
        schema = table.sql_schema()
        assert self._get_sqlite_column_type(schema, 'time') == "TIMESTAMP"


# -----------------------------------------------------------------------------
# -- Database flavor specific tests 
Example #4
Source File: test_sql.py    From vnpy_crypto with MIT License 5 votes vote down vote up
def setup_method(self, datapath):
        self.conn = self.connect()
        self.pandasSQL = sql.SQLiteDatabase(self.conn)

        self._load_iris_data(datapath)

        self._load_test1_data() 
Example #5
Source File: test_sql.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def test_sqlite_type_mapping(self):

        # Test Timestamp objects (no datetime64 because of timezone) (GH9085)
        df = DataFrame({'time': to_datetime(['201412120154', '201412110254'],
                                            utc=True)})
        db = sql.SQLiteDatabase(self.conn)
        table = sql.SQLiteTable("test_type", db, frame=df)
        schema = table.sql_schema()
        assert self._get_sqlite_column_type(schema, 'time') == "TIMESTAMP"


# -----------------------------------------------------------------------------
# -- Database flavor specific tests 
Example #6
Source File: test_sql.py    From predictive-maintenance-using-machine-learning with Apache License 2.0 5 votes vote down vote up
def load_test_data_and_sql(self):
        self.pandasSQL = sql.SQLiteDatabase(self.conn)
        self._load_test1_data() 
Example #7
Source File: test_sql.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def test_sqlite_type_mapping(self):

        # Test Timestamp objects (no datetime64 because of timezone) (GH9085)
        df = DataFrame({'time': to_datetime(['201412120154', '201412110254'],
                                            utc=True)})
        db = sql.SQLiteDatabase(self.conn)
        table = sql.SQLiteTable("test_type", db, frame=df)
        schema = table.sql_schema()
        assert self._get_sqlite_column_type(schema, 'time') == "TIMESTAMP"


# -----------------------------------------------------------------------------
# -- Database flavor specific tests 
Example #8
Source File: test_sql.py    From elasticintel with GNU General Public License v3.0 5 votes vote down vote up
def setup_method(self, method):
        self.conn = self.connect()
        self.pandasSQL = sql.SQLiteDatabase(self.conn)

        self._load_iris_data()

        self._load_test1_data() 
Example #9
Source File: test_sql.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def test_sqlite_type_mapping(self):

        # Test Timestamp objects (no datetime64 because of timezone) (GH9085)
        df = DataFrame({'time': to_datetime(['201412120154', '201412110254'],
                                            utc=True)})
        db = sql.SQLiteDatabase(self.conn)
        table = sql.SQLiteTable("test_type", db, frame=df)
        schema = table.sql_schema()
        assert self._get_sqlite_column_type(schema, 'time') == "TIMESTAMP"


# -----------------------------------------------------------------------------
# -- Database flavor specific tests 
Example #10
Source File: test_sql.py    From twitter-stock-recommendation with MIT License 5 votes vote down vote up
def setup_method(self, datapath):
        self.conn = self.connect()
        self.pandasSQL = sql.SQLiteDatabase(self.conn)

        self._load_iris_data(datapath)

        self._load_test1_data()