File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -736,13 +736,14 @@ def pandasSQL_builder(con, schema: str | None = None):
736
736
if isinstance (con , sqlite3 .Connection ) or con is None :
737
737
return SQLiteDatabase (con )
738
738
739
- sqlalchemy = import_optional_dependency ("sqlalchemy" )
739
+ sqlalchemy = import_optional_dependency ("sqlalchemy" , errors = "ignore" )
740
740
741
- if isinstance (con , str ):
742
- con = sqlalchemy .create_engine (con )
741
+ if sqlalchemy is not None :
742
+ if isinstance (con , str ):
743
+ con = sqlalchemy .create_engine (con )
743
744
744
- if isinstance (con , sqlalchemy .engine .Connectable ):
745
- return SQLDatabase (con , schema = schema )
745
+ if isinstance (con , sqlalchemy .engine .Connectable ):
746
+ return SQLDatabase (con , schema = schema )
746
747
747
748
warnings .warn (
748
749
"pandas only support SQLAlchemy connectable(engine/connection) or"
You can’t perform that action at this time.
0 commit comments