Closed rouilj closed 6 months ago
I have made some changes to solve this issue. can you check it out before I close this issue and let me know if any modifications required.
What checkin should I look at?
Also what part of this issue is your commit addressing?
The only two commit I see are: commit 4f3f1ba2ade on test and commit 8cd949dc1531d on main.
Neither seem to handle unpacking a multilink. They seem to handle part of the stage 1 commit where the link is unset by using the "unset" value.
To followup on our standup discussion.
Setup the test case by creating 4 or 5 keywords. Then assign 2 keywords to issue 1.
This url calling multibarchart should produce a chart:
but it produces an error:
TypeError: unhashable type: 'list'
[...]
second_prop_value = class2.get(second_prop_id, key2) if second_prop_id else "unset" # Get the name of the second property
At this point, second_prop_id
is a list ['1', '2']
, not a single id value that can be looked up in the database.
If the two keywords are key1
and key2
, and the issues only use priority bug and crash, I expect a chart like:
key1 @ @
key2 # @
@ @
@ # @ #
@ # @ #
--------------------------------
bug crash
For the case where I have issues like:
issue # | key1 | key2 | comment |
---|---|---|---|
1 (bug) | + | + | issue 1 has both keywords |
2 (bug) | + | + | |
3 (bug) | + | ||
4 (crash) | + | + | |
5 (crash) | + | ||
6 (crash) | + | ||
7 (crash) | + | ||
8 (crash) | + | ||
9 (crash) | + |
Note that the values of the bars (3, 2, 5, 2) add up to 12 which is not the number of issues. This is fine. I had hoped to have a discussion about how to represent/find options/filter charts like this, but we are out of time.
The chart url shown above results from this query on the index page:
and this multibar link on the index page
I think I have solved the multilink issue theoretically because I don't know how did you add those 2 keywords and all. So I have pushed the code in main branch so please have a look at it and tell me if it solves the problem practically too. I'm sharing commit details. Commit - d30409c
To add keyword use the add keyword link in the left hand pane:
then open issue 1 and add 1,2 in the box for keywords.
Note I opened #87 because I see inconsistent data between the index table and the chart.
Also you left a log of log.append() lines in the commit to main. You probably want to remove them before your final push.
Also I may have been unclear. You created a new branch to do this work on. That's what I wanted. If you want a review, I can pull it from your branch on github (provided you remember to push). It must be on main before you close the ticket however.
Also we had a number of long lived branches that were missing commits from main that made testing from the branched code less useful/harmful. So I test only main code unless asked to look at a particular commit/branch.
The changes I made were right both theoretically and practically. I have added some keywords and review it myself. New changes does solve this issue and I also have merged changes into main and deleted the test_multilink branch.
Make sure #62 is complete first as these touch the same code and the refactoring on #62 will make this easier.
The current code in
get_data_from_query
does something like this (cut down as there are two group variables involved):There is an issue with this. It assumes step 1 returns a single id that can be resolved by step 2. In reality the value from 1 can be in one of three conditions:
Currently step (2) crashes in every case except condition 2.
So we need to support:
do something useful
for barchart and piechart is to iterate over each element of the list (s1) and increment the value. See: https://github.com/UMB-CS682-Team-02/tracker/blob/bc7028db83e942391f9ac3dd59ee359da8bd62d6/demo/extensions/chart.py#L94-L113For the case of two group parameters, this I think iterating over s1 for both group parameters still makes sense as it allows me to find:
Please commit this in two stages to main.
Stage 1:
deal with unset properties
raise an error when a multilink property is used by testing for a list.
Stage 2:
support iterating and counting over multilink properties.
If you want to move stage 2 to a new issue, that is fine.