Skip to content

Commit ed7c624

Browse files
add test for #876
1 parent 65df8cd commit ed7c624

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

datajoint/schemas.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,10 @@ def exists(self):
298298
"""
299299
if self.database is None:
300300
raise DataJointError("Schema must be activated first.")
301-
return self.database is not None and (
302-
self.connection.query(
303-
"SELECT schema_name "
304-
"FROM information_schema.schemata "
305-
"WHERE schema_name = '{database}'".format(
306-
database=self.database)).rowcount > 0)
301+
return bool(self.connection.query(
302+
"SELECT schema_name "
303+
"FROM information_schema.schemata "
304+
"WHERE schema_name = '{database}'".format(database=self.database)).rowcount)
307305

308306
@property
309307
def jobs(self):

tests/test_fetch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,5 +241,9 @@ def test_fetch_format(self):
241241
list1 = sorted(key, key=itemgetter('subject_id'))
242242
for l1, l2 in zip(list1, list2):
243243
assert_dict_equal(l1, l2, 'Primary key is not returned correctly')
244+
245+
# test pandas with fetch1
246+
k = (self.subject & 'subject_id=10').fetch1('KEY')
247+
244248
# revert configuration of fetch format
245249
dj.config['fetch_format'] = 'array'

0 commit comments

Comments
 (0)