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.23 | shaunm | Exception 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.28 | shaunm | any 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.41 | oSoMoN | hi all |
16:21.45 | oSoMoN | anyone knowing storm-twisted knows why resolving lazy values doesn't work? |
16:22.03 | therve | hello |
16:22.28 | oSoMoN | hi therve |
16:22.32 | therve | oSoMoN: because resolving lazy values happens when you access attributes |
16:22.46 | therve | so you would end up with synchronous queries |
16:22.51 | oSoMoN | right |
16:23.06 | oSoMoN | how can I work around thisN |
16:23.08 | oSoMoN | ? |
16:23.45 | therve | you have to use "get" to retrieve the object again |
16:24.15 | oSoMoN | well in my test case the object has just been get_or_create'd |
16:24.52 | oSoMoN | you mean I need to get() it again right after this? |
16:25.27 | therve | if you call add, and that you have values from the database, you should call get right after |
16:27.43 | oSoMoN | thanks, let me try this |
16:29.22 | therve | I'm also thinking about adding a parameter to add to do it automatically for you |
16:34.06 | oSoMoN | yes, that sounds like a handy solution |
16:34.32 | oSoMoN | I would have expected DeferredStore.get_or_create to return me a "usable" object |
16:34.39 | oSoMoN | without having to "get" it again |
16:35.55 | therve | oSoMoN: there is no such thing as get_or_create? |
16:36.19 | oSoMoN | isn't there? |
16:36.32 | therve | not in the twisted-integration branch, at least |
16:37.00 | oSoMoN | indeed |
16:37.02 | oSoMoN | crap |
16:37.16 | therve | this would be a pretty bad feature :) |
16:37.24 | oSoMoN | I'm maintaining an undocumented patched version of the wrapper |
16:38.18 | oSoMoN | and I'm trying to figure my way through this crap |
16:38.32 | therve | heh |
16:38.35 | oSoMoN | alright, so I'll clean that up and then ask :) |
16:38.47 | therve | even my branch is nowhere from being official :) |
16:38.55 | therve | so use it at your own risk, etc |
16:39.01 | oSoMoN | I know |
16:39.03 | oSoMoN | no worries |
16:39.36 | oSoMoN | actually, 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.05 | oSoMoN | but that may take some time, considering the lack of doc my predecessor left me with |
16:40.09 | therve | thanks! |
16:42.27 | oSoMoN | I 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.51 | shaunm | how would I do something like "select count(distinct fieldname) ..."? |
16:58.43 | therve | shaunm: find(...).count(distinct=True) |
16:59.48 | shaunm | but I only know how to return entire rows with find |
17:01.14 | shaunm | oh, I got it |
17:01.45 | shaunm | just realized you can pass a property as the first argument to find |
17:02.52 | therve | find() doesn't return rows directly, it returns a ResultSet |
17:03.02 | shaunm | I understand that |
17:04.13 | shaunm | store.find (pulse.db.Branch.branchable).count(distinct=True) |
17:04.26 | shaunm | that doesn't work, ValueError, "Must specify column when using distinct count" |
17:05.16 | shaunm | oh wait, I think I've got it |
17:05.34 | shaunm | yup, got it. thanks |
17:05.58 | shaunm | need to pass the property to count, not find |
17:51.50 | jamesh | find(Branch).count(Branch.branchable, distinct=True) should give the same query, fwiw |
17:52.09 | jamesh | depending on what else you're doing, that could be useful |
17:54.27 | shaunm | jamesh: that's what I'm doing now, yeah |
17:54.36 | shaunm | well, plus some options to find |
17:55.19 | jamesh | passing things other than tables to find() is mostly useful when using aggregates |
17:55.57 | shaunm | hmm? |
17:56.06 | jamesh | e.g. result = find((Company, Count(Person.id)), Person.company_id == Company.id).group_by(Company) |
17:56.32 | shaunm | sure |
17:56.37 | jamesh | the result values would be (company, number_of_employees) tuples in that case. |
17:56.47 | shaunm | right |
17:57.05 | shaunm | I meant passing more arguments to find, not passing a tuple full of more stuff as the first argument |
17:57.08 | shaunm | i.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) |