Thursday, 2017-02-02

*** openstackgerrit has quit IRC01:02
*** diablo_rojo_phon has quit IRC02:40
*** zara_the_lemur__ has quit IRC03:55
*** Zara has quit IRC06:12
*** Zara has joined #storyboard06:13
*** diablo_rojo has joined #storyboard06:31
*** diablo_rojo has quit IRC07:09
*** fay has joined #storyboard07:49
*** fay is now known as Guest266607:50
*** openstackgerrit has joined #storyboard08:05
openstackgerritAndreas Jaeger proposed openstack-infra/storyboard master: Prepare for using standard python tests  https://review.openstack.org/42758908:05
*** Guest2666 has quit IRC10:32
*** Guest2666 has joined #storyboard10:47
Zaratime for me to learn more sqlalchemy12:01
*** openstackgerrit has quit IRC12:03
* Zara is wondering if there's another way to express this sum to workaround the oddness12:04
Zaraam assuming expr.case is roughly the same as a switch case12:06
Zarahuh I think we also have some weird syntax there12:11
*** openstackgerrit has joined #storyboard12:12
openstackgerritAndreas Jaeger proposed openstack-infra/storyboard master: Prepare for using standard python tests  https://review.openstack.org/42758912:12
Zarashort of other ideas, I've taken to hardcoding stuff that always evaluates to True and seeing what happens12:54
Zaraand have now discovered that python's true/false is ambiguous for sql12:54
ZaraI wonder if that's part of the isue12:55
SotKwhat is the bit that is being puzzling?12:56
Zaraif 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 sum13:02
persiaSQL has three-value logic, TRUE/FALSE/NULL13:03
Zara(so to attempt to debug it, I tried using some statements that should always return true or false)13:07
Zaraand 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 yet13:11
SotKiirc sqlalchemy has a true() and false() which you're meant to use instead of the python literals13:12
Zarayeah13:13
Zarathis was how I changed it: http://paste.openstack.org/show/597349/13:18
Zarait hates everything13:18
Zarait 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 dislikes13:20
Zaraand 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
Zaraso maybe that 'True'? but haven't yet found a way to change that syntax13:21
SotKperhaps 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
SotKI think that is what it currently does13:24
SotKthen 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 broken13:25
SotK(since it doesn't know how True and False should be represented in the query)13:25
Zaraoh, I thought it was saying `CASE WHEN (SUM(...) > 0) THEN 'active'13:34
Zara`13:34
SotKah yeah, that is what I meant13:35
SotKoops13:35
Zaraand 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 value13:35
Zaraso I tried converting my 'things that should evaluate to True' with (foo).is_(true), which didn't work, though not sure of that syntax13: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 stuff13:40
SotKyeah, I have no idea why the sum isn't working13:40
SotKprobably it comes down to what the "..." part of the query is13:40
SotKbut I'm not sure on what it will be13:40
Zarayeah, annoyingly I can print it before it's populated but not after13:41
Zara(I should really work out how to do things with python logging)13:42
SotKthere might be a config option for sqlalchemy to make it spit out the queries it tries to run13:42
SotKbut I can't remember if I ever found one13:42
Zarasum(tasks.status IN (:status_1, :status_2, :status_3))13:45
Zarais what it does before it gets things if that's helpful at all13:45
Zarabut I can't see exactly what it's getting for status_1 et al13:45
SotKI should think it'll be 'todo', 'inprogress', and 'review'13:49
ZaraI'd imagine so but it's annoying that I can't check13:50
SotKdoes sum work differently in postgresql than in mysql?13:50
Zarasince could give a hint as to why sum isn't working13:50
Zarathe bugzilla thing I found yesterday suggested it had a problem with summing booleans13:50
Zaraso I figure it's likely that that's the issue, but I'd like to check things are being passed etc13:51
Zara*postgresql had a prblem with summing booleans13:51
Zarahttps://bugzilla.mozilla.org/show_bug.cgi?id=28412513:51
openstackMozilla bug 284125 in Query/Bug List "PostgreSQL cannot call SUM on a boolean (Boolean Charts)" [Normal,Resolved: fixed] - Assigned to Tomas.Kopal13:51
Zaraso then I was going to find a different way to do it13:52
Zaraand then nothing worked =)13:52
SotKbleh that fix is ugly13:52
* SotK grumbles about postgresql13:52
Zaraso that's where the theoretical chain of if/else came in13:52
ZaraI figured I'd do something like 'if x is 1 then foo elif y is 1 then foo...'13:52
Zaraand then try to tidy it13:52
Zarathen unfortunately discovered that I didn't know how to tell it 'x is 1' in a way it understood13:53
Zaraand here we are :D13:53
Zaraanyway, true() worked13:53
Zara(after importing sql's true and false)13:54
Zaraso maybe I'm getting somewhere13:54
* SotK attempts to create a rough paste of what he would try13: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
Zarait hates it14:01
Zarathough maybe I'm writing it like js again14:02
SotKdoes it work?14:03
Zaranope14:03
ZaraI got http://paste.openstack.org/show/597368/14:04
SotKI made http://paste.openstack.org/show/597369/ to attempt to reconstruct the query from that bugzilla fix14:04
* SotK wrote it thinking in sql rather than thinking in python14:05
Zaraahhh, I didn't know the syntax for that14:05
SotKidk if it will work14:05
Zaraworth a try14:05
Zaramy 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
ZaraI 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
SotKshame it is so ugly14:20
Zarayeah 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 monster14:26
Zarabut I think it worked14:26
Zara('objects' isn't quite right there; too specific, I mean something like 'entities'...)14:26
Zarasyntactic info, not semantic info. that.14:27
Zarathe fruit of my labours: there is not an error message the size of the page when I browse to the 'stories' page14:27
Zaraor a project/project group page14:28
openstackgerritZara proposed openstack-infra/storyboard master: Hacky WIP to provide postgresl support for StoryBoard  https://review.openstack.org/42816514:36
Zaramainly up there for my own reference :)14:36
Zaramission 2: actually be able to create a story14: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 that14:39
ZaraI should be sad but mostly I'm pleased I was able to tell earlier that it was an unrelated error to the other thing14:40
* SotK has no clue about that one14:45
Zarame neither, yet, but I haven't looked hard yet14:45
Zarait might be an issue with my db migration script14:46
Zarawell, caused by an issue in that14:46
*** persia_ has joined #storyboard15:48
* Zara notices she misspelled postgresql in that commit title16:16
ZaraI think it adds to its charm16: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
Zaramy favourite kind of debuginfo16:46
persiaTo me, that reads as "stories_story_type_id_fkey'16:47
persiaTo 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 IRC16:50
Zaramaybe, though I'm wondering why it wouldn't be Type Error if that were the case16:51
persiaThe 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 reproduction16:59
Zara:) right now I'll just be pleased if I work out how it's all meant to work17:02
Zarathe keys code is still in my bucket of 'mysterious things databases need to relate things to each other'17:03
*** bethwhite has quit IRC17:47
*** zara_the_lemur__ has joined #storyboard18:41
*** bethwhite has joined #storyboard18:50
*** bethwhite has quit IRC19:53
*** bethwhite has joined #storyboard20:17
*** bethwhite has quit IRC20:54
*** bethwhite has joined #storyboard21:25
*** bethwhite has quit IRC21:31
-openstackstatus- NOTICE: Restarting gerrit due to performance problems22:52

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!