IRC log for #storm on 20090305

00:00.19*** join/#storm wallflower (n=wallflow@ip-205-246-113-216.pool.grokthis.net)
00:02.29*** join/#storm oubiwann (n=oubiwann@97-119-85-2.omah.qwest.net)
00:08.23*** join/#storm jamesh (n=james@canonical/launchpad/jamesh)
00:19.23shaunmException exceptions.AttributeError: "'NoneType' object has no attribute 'dumps'" in <bound method ObjectInfo._emit_object_deleted of {'invalidated': True, 'store': <storm.store.Store object at 0xb7c3006c>, 'primary_vars': (<storm.variables.IntVariable object at 0xb79d9e4c>,)}> ignored
00:19.28shaunmany idea what that's about?
00:35.16*** join/#storm oubiwann (n=oubiwann@97-119-85-2.omah.qwest.net)
01:55.01*** join/#storm vvinet (n=vince@modemcable088.175-57-74.mc.videotron.ca)
03:35.58*** join/#storm vvinet (n=vince@modemcable088.175-57-74.mc.videotron.ca)
04:36.48*** join/#storm oubiwann (n=oubiwann@97-119-85-2.omah.qwest.net)
04:44.46*** join/#storm oubiwann (n=oubiwann@97-119-85-2.omah.qwest.net)
04:54.34*** join/#storm oubiwann (n=oubiwann@97-119-85-2.omah.qwest.net)
06:05.48*** join/#storm jukart (n=jukart@d91-128-122-97.cust.tele2.at)
07:12.10*** join/#storm jukart (i=lovely@81.189.156.94)
07:57.57*** join/#storm vvinet (n=vince@modemcable088.175-57-74.mc.videotron.ca)
08:14.43*** join/#storm goschtl (n=goschtl@p5B0BF361.dip.t-dialin.net)
10:36.54*** join/#storm jukart (i=lovely@81.189.156.94)
10:49.50*** join/#storm jukart (i=lovely@81.189.156.94) [NETSPLIT VICTIM]
11:46.24*** join/#storm artista_frustrad (n=artista_@201-25-170-107.ctame704.dsl.brasiltelecom.net.br)
12:20.37*** join/#storm gord (n=gord@5ac32853.bb.sky.com)
12:25.40*** join/#storm niemeyer (n=niemeyer@200-103-244-201.ctame705.dsl.brasiltelecom.net.br)
13:04.04*** join/#storm sidnei (n=sidnei@plone/dreamcatcher)
14:07.10*** join/#storm jamesh (n=james@canonical/launchpad/jamesh)
14:30.32*** join/#storm deryck (n=deryck@samba/team/deryck)
15:03.09*** join/#storm artista_frustrad (n=artista_@200-181-174-153.ctame704.dsl.brasiltelecom.net.br)
15:35.57*** join/#storm vvinet (n=vince@modemcable088.175-57-74.mc.videotron.ca)
16:17.30*** join/#storm oSoMoN (n=osomon@o.bcn.fluendo.net)
16:17.41oSoMoNhi all
16:21.45oSoMoNanyone knowing storm-twisted knows why resolving lazy values doesn't work?
16:22.03thervehello
16:22.28oSoMoNhi therve
16:22.32therveoSoMoN: because resolving lazy values happens when you access attributes
16:22.46therveso you would end up with synchronous queries
16:22.51oSoMoNright
16:23.06oSoMoNhow can I work around thisN
16:23.08oSoMoN?
16:23.45therveyou have to use "get" to retrieve the object again
16:24.15oSoMoNwell in my test case the object has just been get_or_create'd
16:24.52oSoMoNyou mean I need to get() it again right after this?
16:25.27therveif you call add, and that you have values from the database, you should call get right after
16:27.43oSoMoNthanks, let me try this
16:29.22therveI'm also thinking about adding a parameter to add to do it automatically for you
16:34.06oSoMoNyes, that sounds like a handy solution
16:34.32oSoMoNI would have expected DeferredStore.get_or_create to return me a "usable" object
16:34.39oSoMoNwithout having to "get" it again
16:35.55therveoSoMoN: there is no such thing as get_or_create?
16:36.19oSoMoNisn't there?
16:36.32thervenot in the twisted-integration branch, at least
16:37.00oSoMoNindeed
16:37.02oSoMoNcrap
16:37.16thervethis would be a pretty bad feature :)
16:37.24oSoMoNI'm maintaining an undocumented patched version of the wrapper
16:38.18oSoMoNand I'm trying to figure my way through this crap
16:38.32therveheh
16:38.35oSoMoNalright, so I'll clean that up and then ask :)
16:38.47therveeven my branch is nowhere from being official :)
16:38.55therveso use it at your own risk, etc
16:39.01oSoMoNI know
16:39.03oSoMoNno worries
16:39.36oSoMoNactually, once my cleanup is done and I have figured out what the patches there are for and if they really are useful, I'll submit them to you
16:40.05oSoMoNbut that may take some time, considering the lack of doc my predecessor left me with
16:40.09thervethanks!
16:42.27oSoMoNI should have guessed from the look of the code that this get_or_create thingy was not belonging here
16:55.09*** join/#storm shaunm (n=shaunm@proxyserver.wolfram.com)
16:56.51shaunmhow would I do something like "select count(distinct fieldname) ..."?
16:58.43therveshaunm: find(...).count(distinct=True)
16:59.48shaunmbut I only know how to return entire rows with find
17:01.14shaunmoh, I got it
17:01.45shaunmjust realized you can pass a property as the first argument to find
17:02.52thervefind() doesn't return rows directly, it returns a ResultSet
17:03.02shaunmI understand that
17:04.13shaunmstore.find (pulse.db.Branch.branchable).count(distinct=True)
17:04.26shaunmthat doesn't work, ValueError, "Must specify column when using distinct count"
17:05.16shaunmoh wait, I think I've got it
17:05.34shaunmyup, got it.  thanks
17:05.58shaunmneed to pass the property to count, not find
17:51.50jameshfind(Branch).count(Branch.branchable, distinct=True) should give the same query, fwiw
17:52.09jameshdepending on what else you're doing, that could be useful
17:54.27shaunmjamesh: that's what I'm doing now, yeah
17:54.36shaunmwell, plus some options to find
17:55.19jameshpassing things other than tables to find() is mostly useful when using aggregates
17:55.57shaunmhmm?
17:56.06jameshe.g. result = find((Company, Count(Person.id)), Person.company_id == Company.id).group_by(Company)
17:56.32shaunmsure
17:56.37jameshthe result values would be (company, number_of_employees) tuples in that case.
17:56.47shaunmright
17:57.05shaunmI meant passing more arguments to find, not passing a tuple full of more stuff as the first argument
17:57.08shaunmi.e. filtering
20:05.59*** join/#storm thumper (n=tim@canonical/launchpad/thumper)
22:57.50*** join/#storm artista_frustrad (n=artista_@201-40-216-66.ctame704.dsl.brasiltelecom.net.br)
23:56.43*** join/#storm jamesh (n=james@canonical/launchpad/jamesh)

Generated by irclog2html.pl Modified by Tim Riker to work with infobot.