예제 #1
0
 def setup_connect(self):
     try:
         self.conn = self.connect()
         self.pandasSQL = sql.PandasSQLAlchemy(self.conn)
     except sqlalchemy.exc.OperationalError:
         raise nose.SkipTest("Can't connect to {0} server".format(
             self.flavor))
예제 #2
0
파일: test_sql.py 프로젝트: mindw/pandas
    def test_create_table(self):
        temp_conn = self.connect()
        temp_frame = DataFrame(
            {'one': [1., 2., 3., 4.], 'two': [4., 3., 2., 1.]})

        pandasSQL = sql.PandasSQLAlchemy(temp_conn)
        pandasSQL.to_sql(temp_frame, 'temp_frame')

        self.assertTrue(
            temp_conn.has_table('temp_frame'), 'Table not written to DB')
예제 #3
0
    def setUp(self):
        # Skip this test if SQLAlchemy not available
        if not SQLALCHEMY_INSTALLED:
            raise nose.SkipTest('SQLAlchemy not installed')

        self.conn = self.connect()
        self.pandasSQL = sql.PandasSQLAlchemy(self.conn)

        self._load_iris_data()
        self._load_raw_sql()

        self._load_test1_data()
예제 #4
0
    def setUp(self):
        if not SQLALCHEMY_INSTALLED:
            raise nose.SkipTest('SQLAlchemy not installed')

        try:
            import psycopg2
            self.driver = 'psycopg2'

        except ImportError:
            raise nose.SkipTest

        self.conn = self.connect()
        self.pandasSQL = sql.PandasSQLAlchemy(self.conn)

        self._load_iris_data()
        self._load_raw_sql()

        self._load_test1_data()