@@ -41,24 +41,6 @@ class DatabaseError(IOError):
4141_SQLALCHEMY_INSTALLED  =  None 
4242
4343
44- def  _validate_flavor_parameter (flavor ):
45-     """ 
46-     Checks whether a database 'flavor' was specified. 
47-     If not None, produces FutureWarning if 'sqlite' and 
48-     raises a ValueError if anything else. 
49-     """ 
50-     if  flavor  is  not   None :
51-         if  flavor  ==  'sqlite' :
52-             warnings .warn ("the 'flavor' parameter is deprecated " 
53-                           "and will be removed in a future version, " 
54-                           "as 'sqlite' is the only supported option " 
55-                           "when SQLAlchemy is not installed." ,
56-                           FutureWarning , stacklevel = 2 )
57-         else :
58-             raise  ValueError ("database flavor {flavor} is not " 
59-                              "supported" .format (flavor = flavor ))
60- 
61- 
6244def  _is_sqlalchemy_connectable (con ):
6345    global  _SQLALCHEMY_INSTALLED 
6446    if  _SQLALCHEMY_INSTALLED  is  None :
@@ -415,8 +397,8 @@ def read_sql(sql, con, index_col=None, coerce_float=True, params=None,
415397            chunksize = chunksize )
416398
417399
418- def  to_sql (frame , name , con , flavor = None ,  schema = None , if_exists = 'fail' ,
419-            index = True ,  index_label = None , chunksize = None , dtype = None ):
400+ def  to_sql (frame , name , con , schema = None , if_exists = 'fail' ,  index = True ,
401+            index_label = None , chunksize = None , dtype = None ):
420402    """ 
421403    Write records stored in a DataFrame to a SQL database. 
422404
@@ -430,10 +412,6 @@ def to_sql(frame, name, con, flavor=None, schema=None, if_exists='fail',
430412        Using SQLAlchemy makes it possible to use any DB supported by that 
431413        library. 
432414        If a DBAPI2 object, only sqlite3 is supported. 
433-     flavor : 'sqlite', default None 
434-         .. deprecated:: 0.19.0 
435-            'sqlite' is the only supported option if SQLAlchemy is not 
436-            used. 
437415    schema : string, default None 
438416        Name of SQL schema in database to write to (if database flavor 
439417        supports this). If None, use default schema (default). 
@@ -459,7 +437,7 @@ def to_sql(frame, name, con, flavor=None, schema=None, if_exists='fail',
459437    if  if_exists  not  in   ('fail' , 'replace' , 'append' ):
460438        raise  ValueError ("'{0}' is not valid for if_exists" .format (if_exists ))
461439
462-     pandas_sql  =  pandasSQL_builder (con , schema = schema ,  flavor = flavor )
440+     pandas_sql  =  pandasSQL_builder (con , schema = schema )
463441
464442    if  isinstance (frame , Series ):
465443        frame  =  frame .to_frame ()
@@ -472,7 +450,7 @@ def to_sql(frame, name, con, flavor=None, schema=None, if_exists='fail',
472450                      chunksize = chunksize , dtype = dtype )
473451
474452
475- def  has_table (table_name , con , flavor = None ,  schema = None ):
453+ def  has_table (table_name , con , schema = None ):
476454    """ 
477455    Check if DataBase has named table. 
478456
@@ -484,10 +462,6 @@ def has_table(table_name, con, flavor=None, schema=None):
484462        Using SQLAlchemy makes it possible to use any DB supported by that 
485463        library. 
486464        If a DBAPI2 object, only sqlite3 is supported. 
487-     flavor : 'sqlite', default None 
488-         .. deprecated:: 0.19.0 
489-            'sqlite' is the only supported option if SQLAlchemy is not 
490-            installed. 
491465    schema : string, default None 
492466        Name of SQL schema in database to write to (if database flavor supports 
493467        this). If None, use default schema (default). 
@@ -496,7 +470,7 @@ def has_table(table_name, con, flavor=None, schema=None):
496470    ------- 
497471    boolean 
498472    """ 
499-     pandas_sql  =  pandasSQL_builder (con , flavor = flavor ,  schema = schema )
473+     pandas_sql  =  pandasSQL_builder (con , schema = schema )
500474    return  pandas_sql .has_table (table_name )
501475
502476
@@ -521,14 +495,12 @@ def _engine_builder(con):
521495    return  con 
522496
523497
524- def  pandasSQL_builder (con , flavor = None ,  schema = None , meta = None ,
498+ def  pandasSQL_builder (con , schema = None , meta = None ,
525499                      is_cursor = False ):
526500    """ 
527501    Convenience function to return the correct PandasSQL subclass based on the 
528502    provided parameters. 
529503    """ 
530-     _validate_flavor_parameter (flavor )
531- 
532504    # When support for DBAPI connections is removed, 
533505    # is_cursor should not be necessary. 
534506    con  =  _engine_builder (con )
@@ -1378,9 +1350,7 @@ class SQLiteDatabase(PandasSQL):
13781350
13791351    """ 
13801352
1381-     def  __init__ (self , con , flavor = None , is_cursor = False ):
1382-         _validate_flavor_parameter (flavor )
1383- 
1353+     def  __init__ (self , con , is_cursor = False ):
13841354        self .is_cursor  =  is_cursor 
13851355        self .con  =  con 
13861356
@@ -1534,7 +1504,7 @@ def _create_sql_schema(self, frame, table_name, keys=None, dtype=None):
15341504        return  str (table .sql_schema ())
15351505
15361506
1537- def  get_schema (frame , name , flavor = None ,  keys = None , con = None , dtype = None ):
1507+ def  get_schema (frame , name , keys = None , con = None , dtype = None ):
15381508    """ 
15391509    Get the SQL db table schema for the given frame. 
15401510
@@ -1549,15 +1519,11 @@ def get_schema(frame, name, flavor=None, keys=None, con=None, dtype=None):
15491519        Using SQLAlchemy makes it possible to use any DB supported by that 
15501520        library, default: None 
15511521        If a DBAPI2 object, only sqlite3 is supported. 
1552-     flavor : 'sqlite', default None 
1553-         .. deprecated:: 0.19.0 
1554-            'sqlite' is the only supported option if SQLAlchemy is not 
1555-            installed. 
15561522    dtype : dict of column name to SQL type, default None 
15571523        Optional specifying the datatype for columns. The SQL type should 
15581524        be a SQLAlchemy type, or a string for sqlite3 fallback connection. 
15591525
15601526    """ 
15611527
1562-     pandas_sql  =  pandasSQL_builder (con = con ,  flavor = flavor )
1528+     pandas_sql  =  pandasSQL_builder (con = con )
15631529    return  pandas_sql ._create_sql_schema (frame , name , keys = keys , dtype = dtype )
0 commit comments