*** openstackgerrit has quit IRC | 01:02 | |
*** diablo_rojo_phon has quit IRC | 02:40 | |
*** zara_the_lemur__ has quit IRC | 03:55 | |
*** Zara has quit IRC | 06:12 | |
*** Zara has joined #storyboard | 06:13 | |
*** diablo_rojo has joined #storyboard | 06:31 | |
*** diablo_rojo has quit IRC | 07:09 | |
*** fay has joined #storyboard | 07:49 | |
*** fay is now known as Guest2666 | 07:50 | |
*** openstackgerrit has joined #storyboard | 08:05 | |
openstackgerrit | Andreas Jaeger proposed openstack-infra/storyboard master: Prepare for using standard python tests https://review.openstack.org/427589 | 08:05 |
---|---|---|
*** Guest2666 has quit IRC | 10:32 | |
*** Guest2666 has joined #storyboard | 10:47 | |
Zara | time for me to learn more sqlalchemy | 12:01 |
*** openstackgerrit has quit IRC | 12:03 | |
* Zara is wondering if there's another way to express this sum to workaround the oddness | 12:04 | |
Zara | am assuming expr.case is roughly the same as a switch case | 12:06 |
Zara | huh I think we also have some weird syntax there | 12:11 |
*** openstackgerrit has joined #storyboard | 12:12 | |
openstackgerrit | Andreas Jaeger proposed openstack-infra/storyboard master: Prepare for using standard python tests https://review.openstack.org/427589 | 12:12 |
Zara | short of other ideas, I've taken to hardcoding stuff that always evaluates to True and seeing what happens | 12:54 |
Zara | and have now discovered that python's true/false is ambiguous for sql | 12:54 |
Zara | I wonder if that's part of the isue | 12:55 |
SotK | what is the bit that is being puzzling? | 12:56 |
Zara | if I've understood rightly (big if), https://github.com/openstack-infra/storyboard/blob/4926b471e2ccf0f4adb6e92e9f26769c942ae621/storyboard/db/models.py#L444-L449 is failing as it's not getting a value that can be compared with 0 from the sum | 13:02 |
persia | SQL has three-value logic, TRUE/FALSE/NULL | 13:03 |
Zara | (so to attempt to debug it, I tried using some statements that should always return true or false) | 13:07 |
Zara | and now I'm seeing a lot of sqlalchemy.exc.ArgumentError: Ambiguous literal: True. Use the 'text()' function to indicate a SQL expression literal, or 'literal()' to indicate a bound value. | 13:10 |
Zara | but not sure where it actually originates yet | 13:11 |
SotK | iirc sqlalchemy has a true() and false() which you're meant to use instead of the python literals | 13:12 |
Zara | yeah | 13:13 |
Zara | this was how I changed it: http://paste.openstack.org/show/597349/ | 13:18 |
Zara | it hates everything | 13:18 |
Zara | it complains about the 'else', but if I comment it out hackily, it just complains about the next line up, so I don't know what exactly it dislikes | 13:20 |
Zara | and I noticed this: result = select(select_items, None, | 13:20 |
Zara | expr.Join(Story, Task, onclause=Story.id == Task.story_id, | 13:20 |
Zara | isouter=True)) \ | 13:20 |
Zara | so maybe that 'True'? but haven't yet found a way to change that syntax | 13:21 |
SotK | perhaps it is complaining because expr.case creates an SQL statement from its arguments, like `CASE WHEN SUM(...) THEN 'active' WHEN SUM(...) THEN 'invalid'...` | 13:24 |
SotK | I think that is what it currently does | 13:24 |
SotK | then your version would create `CASE WHEN True THEN 'active' WHEN False THEN 'invalid'` but sqlalchemy won't let you because that would be a bit broken | 13:25 |
SotK | (since it doesn't know how True and False should be represented in the query) | 13:25 |
Zara | oh, I thought it was saying `CASE WHEN (SUM(...) > 0) THEN 'active' | 13:34 |
Zara | ` | 13:34 |
SotK | ah yeah, that is what I meant | 13:35 |
SotK | oops | 13:35 |
Zara | and it was having trouble summing the parts because of a bug, maybe, so then it wasn't getting a thing to compare to 0, so it wasn't getting a truth value | 13:35 |
Zara | so I tried converting my 'things that should evaluate to True' with (foo).is_(true), which didn't work, though not sure of that syntax | 13:38 |
Zara | (that was after I couldn't think of a way around the sum that wasn't working; I wanted to try with chain of if/else but then I couldn't figure out how to get that to work with the rest of it...) | 13:39 |
* SotK did boolean comparison with `foo == true()` in the worklists permissions stuff | 13:40 | |
SotK | yeah, I have no idea why the sum isn't working | 13:40 |
SotK | probably it comes down to what the "..." part of the query is | 13:40 |
SotK | but I'm not sure on what it will be | 13:40 |
Zara | yeah, annoyingly I can print it before it's populated but not after | 13:41 |
Zara | (I should really work out how to do things with python logging) | 13:42 |
SotK | there might be a config option for sqlalchemy to make it spit out the queries it tries to run | 13:42 |
SotK | but I can't remember if I ever found one | 13:42 |
Zara | sum(tasks.status IN (:status_1, :status_2, :status_3)) | 13:45 |
Zara | is what it does before it gets things if that's helpful at all | 13:45 |
Zara | but I can't see exactly what it's getting for status_1 et al | 13:45 |
SotK | I should think it'll be 'todo', 'inprogress', and 'review' | 13:49 |
Zara | I'd imagine so but it's annoying that I can't check | 13:50 |
SotK | does sum work differently in postgresql than in mysql? | 13:50 |
Zara | since could give a hint as to why sum isn't working | 13:50 |
Zara | the bugzilla thing I found yesterday suggested it had a problem with summing booleans | 13:50 |
Zara | so I figure it's likely that that's the issue, but I'd like to check things are being passed etc | 13:51 |
Zara | *postgresql had a prblem with summing booleans | 13:51 |
Zara | https://bugzilla.mozilla.org/show_bug.cgi?id=284125 | 13:51 |
openstack | Mozilla bug 284125 in Query/Bug List "PostgreSQL cannot call SUM on a boolean (Boolean Charts)" [Normal,Resolved: fixed] - Assigned to Tomas.Kopal | 13:51 |
Zara | so then I was going to find a different way to do it | 13:52 |
Zara | and then nothing worked =) | 13:52 |
SotK | bleh that fix is ugly | 13:52 |
* SotK grumbles about postgresql | 13:52 | |
Zara | so that's where the theoretical chain of if/else came in | 13:52 |
Zara | I figured I'd do something like 'if x is 1 then foo elif y is 1 then foo...' | 13:52 |
Zara | and then try to tidy it | 13:52 |
Zara | then unfortunately discovered that I didn't know how to tell it 'x is 1' in a way it understood | 13:53 |
Zara | and here we are :D | 13:53 |
Zara | anyway, true() worked | 13:53 |
Zara | (after importing sql's true and false) | 13:54 |
Zara | so maybe I'm getting somewhere | 13:54 |
* SotK attempts to create a rough paste of what he would try | 13:54 | |
Zara | (yeah originally I tried to tweak that fix but couldn't get it to fit) | 13:55 |
Zara | (so I went back to basics) | 13:55 |
* Zara tries a hacky http://paste.openstack.org/show/597367/ | 14:01 | |
Zara | it hates it | 14:01 |
Zara | though maybe I'm writing it like js again | 14:02 |
SotK | does it work? | 14:03 |
Zara | nope | 14:03 |
Zara | I got http://paste.openstack.org/show/597368/ | 14:04 |
SotK | I made http://paste.openstack.org/show/597369/ to attempt to reconstruct the query from that bugzilla fix | 14:04 |
* SotK wrote it thinking in sql rather than thinking in python | 14:05 | |
Zara | ahhh, I didn't know the syntax for that | 14:05 |
SotK | idk if it will work | 14:05 |
Zara | worth a try | 14:05 |
Zara | my earlier attempt was in python, involved concatenating strings, and didn't work at all. | 14:05 |
Zara | (and I suspect my current thing is failing as I can't get the task statuses like that and it has to be done as a group or something but idk) | 14:06 |
Zara | I think your version worked and it's getting a bit further now :) | 14:19 |
Zara | (it's failing on another similar sum thing so I'll try to use similar syntax there) | 14:19 |
SotK | \o/ | 14:20 |
SotK | shame it is so ugly | 14:20 |
Zara | yeah atm I'm copying it like 'square bracket curved bracket newline' rather than even attempting to think of it in terms of obejects... | 14:26 |
* Zara is a monster | 14:26 | |
Zara | but I think it worked | 14:26 |
Zara | ('objects' isn't quite right there; too specific, I mean something like 'entities'...) | 14:26 |
Zara | syntactic info, not semantic info. that. | 14:27 |
Zara | the fruit of my labours: there is not an error message the size of the page when I browse to the 'stories' page | 14:27 |
Zara | or a project/project group page | 14:28 |
openstackgerrit | Zara proposed openstack-infra/storyboard master: Hacky WIP to provide postgresl support for StoryBoard https://review.openstack.org/428165 | 14:36 |
Zara | mainly up there for my own reference :) | 14:36 |
Zara | mission 2: actually be able to create a story | 14:39 |
Zara | `400: POST /api/v1/stories: Foreign key error. Error in object 'Story'. Field 'story_type_id' value 'stories_story_type_id_fkey' is invalid.` is the current error for that | 14:39 |
Zara | I should be sad but mostly I'm pleased I was able to tell earlier that it was an unrelated error to the other thing | 14:40 |
* SotK has no clue about that one | 14:45 | |
Zara | me neither, yet, but I haven't looked hard yet | 14:45 |
Zara | it might be an issue with my db migration script | 14:46 |
Zara | well, caused by an issue in that | 14:46 |
*** persia_ has joined #storyboard | 15:48 | |
* Zara notices she misspelled postgresql in that commit title | 16:16 | |
Zara | I think it adds to its charm | 16:16 |
Zara | {"faultcode": "Client", "faultstring": "Foreign key error. Error in object 'Story'. Field 'story_type_id' | 16:46 |
Zara | value 'stories_story_type_id_fkey' is invalid.", "debuginfo": null} | 16:46 |
Zara | my favourite kind of debuginfo | 16:46 |
persia | To me, that reads as "stories_story_type_id_fkey' | 16:47 |
persia | To me, that reads as "'stories_story_type_id_fkey' is a string, and I wanted a different type." | 16:47 |
* persia looks for a keyboard layout where "Return" is positioned less close to "shift" | 16:48 | |
*** Guest2666 has quit IRC | 16:50 | |
Zara | maybe, though I'm wondering why it wouldn't be Type Error if that were the case | 16:51 |
persia | The other possibility is trying to create a new object with a key that already exists. | 16:58 |
persia | (Well, one other possibility) | 16:59 |
* persia stops trying to intuit error info without reproduction | 16:59 | |
Zara | :) right now I'll just be pleased if I work out how it's all meant to work | 17:02 |
Zara | the keys code is still in my bucket of 'mysterious things databases need to relate things to each other' | 17:03 |
*** bethwhite has quit IRC | 17:47 | |
*** zara_the_lemur__ has joined #storyboard | 18:41 | |
*** bethwhite has joined #storyboard | 18:50 | |
*** bethwhite has quit IRC | 19:53 | |
*** bethwhite has joined #storyboard | 20:17 | |
*** bethwhite has quit IRC | 20:54 | |
*** bethwhite has joined #storyboard | 21:25 | |
*** bethwhite has quit IRC | 21:31 | |
-openstackstatus- NOTICE: Restarting gerrit due to performance problems | 22:52 |
Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!