@@ -2181,26 +2181,26 @@ def test_connectable_issue_example(self):
2181
2181
# https://github.com/pandas-dev/pandas/issues/10104
2182
2182
from sqlalchemy .engine import Engine
2183
2183
2184
- def foo (connection ):
2184
+ def test_select (connection ):
2185
2185
query = "SELECT test_foo_data FROM test_foo_data"
2186
2186
return sql .read_sql_query (query , con = connection )
2187
2187
2188
- def bar (connection , data ):
2188
+ def test_append (connection , data ):
2189
2189
data .to_sql (name = "test_foo_data" , con = connection , if_exists = "append" )
2190
2190
2191
- def baz (conn ):
2191
+ def test_connectable (conn ):
2192
2192
# https://github.com/sqlalchemy/sqlalchemy/commit/
2193
2193
# 00b5c10846e800304caa86549ab9da373b42fa5d#r48323973
2194
- foo_data = foo (conn )
2195
- bar (conn , foo_data )
2194
+ foo_data = test_select (conn )
2195
+ test_append (conn , foo_data )
2196
2196
2197
2197
def main (connectable ):
2198
2198
if isinstance (connectable , Engine ):
2199
2199
with connectable .connect () as conn :
2200
2200
with conn .begin ():
2201
- baz (conn )
2201
+ test_connectable (conn )
2202
2202
else :
2203
- baz (connectable )
2203
+ test_connectable (connectable )
2204
2204
2205
2205
assert (
2206
2206
DataFrame ({"test_foo_data" : [0 , 1 , 2 ]}).to_sql ("test_foo_data" , self .conn )
@@ -2373,21 +2373,21 @@ def test_row_object_is_named_tuple(self):
2373
2373
class Test (BaseModel ):
2374
2374
__tablename__ = "test_frame"
2375
2375
id = Column (Integer , primary_key = True )
2376
- foo = Column (String (50 ))
2376
+ string_column = Column (String (50 ))
2377
2377
2378
2378
BaseModel .metadata .create_all (self .conn )
2379
2379
Session = sessionmaker (bind = self .conn )
2380
2380
with Session () as session :
2381
- df = DataFrame ({"id" : [0 , 1 ], "foo " : ["hello" , "world" ]})
2381
+ df = DataFrame ({"id" : [0 , 1 ], "string_column " : ["hello" , "world" ]})
2382
2382
assert (
2383
2383
df .to_sql ("test_frame" , con = self .conn , index = False , if_exists = "replace" )
2384
2384
== 2
2385
2385
)
2386
2386
session .commit ()
2387
- foo = session .query (Test .id , Test .foo )
2388
- df = DataFrame (foo )
2387
+ test_query = session .query (Test .id , Test .string_column )
2388
+ df = DataFrame (test_query )
2389
2389
2390
- assert list (df .columns ) == ["id" , "foo " ]
2390
+ assert list (df .columns ) == ["id" , "string_column " ]
2391
2391
2392
2392
2393
2393
class _TestMySQLAlchemy :
0 commit comments