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))
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')
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()
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()