RelationProperty, to be consistent
with all the other names. PropertyLoader is
still present as a synonym.
+
+ - fixed "double iter()" call causing bus errors
+ in shard API, removed errant result.close()
+ left over from the 0.4 version. [ticket:1099]
+ [ticket:1228]
- sql
- Fixed the import weirdness in sqlalchemy.sql
def _execute_and_instances(self, context):
if self._shard_id is not None:
result = self.session.connection(mapper=self._mapper_zero(), shard_id=self._shard_id).execute(context.statement, self._params)
- try:
- return iter(self.instances(result, context))
- finally:
- result.close()
+ return self.instances(result, context)
else:
partial = []
for shard_id in self.query_chooser(self):
result = self.session.connection(mapper=self._mapper_zero(), shard_id=shard_id).execute(context.statement, self._params)
- try:
- partial = partial + list(self.instances(result, context))
- finally:
- result.close()
+ partial = partial + list(self.instances(result, context))
# if some kind of in memory 'sorting' were done, this is where it would happen
return iter(partial)
assert db2.execute(weather_locations.select()).fetchall() == [(1, 'Asia', 'Tokyo')]
assert db1.execute(weather_locations.select()).fetchall() == [(2, 'North America', 'New York'), (3, 'North America', 'Toronto')]
- # TODO: bus errors on some platforms, ticket #1099
-# t = sess.query(WeatherLocation).get(tokyo.id)
-# assert t.city == tokyo.city
-# assert t.reports[0].temperature == 80.0
+ t = sess.query(WeatherLocation).get(tokyo.id)
+ assert t.city == tokyo.city
+ assert t.reports[0].temperature == 80.0
north_american_cities = sess.query(WeatherLocation).filter(WeatherLocation.continent == 'North America')
assert set([c.city for c in north_american_cities]) == set(['New York', 'Toronto'])