)]}'
{"subunit2sql/db/api.py":[{"author":{"_account_id":1921,"name":"Andrea Frittoli","email":"andrea.frittoli@gmail.com","username":"andrea-frittoli"},"change_message_id":"ce36974ebdee5bd5370b8c6605b8d8234c98d12b","unresolved":false,"context_lines":[{"line_number":943,"context_line":"                                 models.Run.skips,"},{"line_number":944,"context_line":"                                 models.Run.run_time,"},{"line_number":945,"context_line":"                                 models.Run.run_at,"},{"line_number":946,"context_line":"                                 models.RunMetadata.key,"},{"line_number":947,"context_line":"                                 models.RunMetadata.value)"},{"line_number":948,"context_line":"    runs \u003d {}"},{"line_number":949,"context_line":"    for run in run_query:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_48cbc072","line":946,"updated":"2015-09-15 22:53:02.000000000","message":"Why do we need metadata here (and below in the generated series)? It\u0027s what you\u0027re filtering on, so it\u0027s going to be the same for each row in the series.","commit_id":"d74be498fd829bc5ade11aafd27ba93476f18acf"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"47c0b8f9698c4fd65768eae0c807e6f6f18385e3","unresolved":false,"context_lines":[{"line_number":943,"context_line":"                                 models.Run.skips,"},{"line_number":944,"context_line":"                                 models.Run.run_time,"},{"line_number":945,"context_line":"                                 models.Run.run_at,"},{"line_number":946,"context_line":"                                 models.RunMetadata.key,"},{"line_number":947,"context_line":"                                 models.RunMetadata.value)"},{"line_number":948,"context_line":"    runs \u003d {}"},{"line_number":949,"context_line":"    for run in run_query:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_889c71c1","line":946,"in_reply_to":"ba15a1d1_488660ba","updated":"2015-09-16 04:02:32.000000000","message":"Yeah so I just confirmed that this query is wrong, we\u0027re dropping all the other metadata which is not the intent.\n\nI\u0027ll have to look into how to write the query where we preserve all the metadata for the run but only for runs which have a metadata match for key and value.","commit_id":"d74be498fd829bc5ade11aafd27ba93476f18acf"},{"author":{"_account_id":5196,"name":"Matthew Treinish","email":"mtreinish@kortar.org","username":"treinish"},"change_message_id":"7d0ad9312321c953887b5e59c0069706af5fb191","unresolved":false,"context_lines":[{"line_number":943,"context_line":"                                 models.Run.skips,"},{"line_number":944,"context_line":"                                 models.Run.run_time,"},{"line_number":945,"context_line":"                                 models.Run.run_at,"},{"line_number":946,"context_line":"                                 models.RunMetadata.key,"},{"line_number":947,"context_line":"                                 models.RunMetadata.value)"},{"line_number":948,"context_line":"    runs \u003d {}"},{"line_number":949,"context_line":"    for run in run_query:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_488660ba","line":946,"in_reply_to":"ba15a1d1_48cbc072","updated":"2015-09-15 23:06:49.000000000","message":"We need this because we\u0027re filtering runs by key value pair on metadata. but the run still has other metadata associated with it. We want this in the response.\n\nThe use case for this is we want to get a time series of all runs and their associated metadata for a given project or job type.\n\nBut, I think you\u0027re right I might have to do a 2 part query or something because I don\u0027t want to lose the other metadata","commit_id":"d74be498fd829bc5ade11aafd27ba93476f18acf"},{"author":{"_account_id":1921,"name":"Andrea Frittoli","email":"andrea.frittoli@gmail.com","username":"andrea-frittoli"},"change_message_id":"e99a6e319dd016160e13d11e6629796d6e867f74","unresolved":false,"context_lines":[{"line_number":943,"context_line":"                                 models.Run.skips,"},{"line_number":944,"context_line":"                                 models.Run.run_time,"},{"line_number":945,"context_line":"                                 models.Run.run_at,"},{"line_number":946,"context_line":"                                 models.RunMetadata.key,"},{"line_number":947,"context_line":"                                 models.RunMetadata.value)"},{"line_number":948,"context_line":"    runs \u003d {}"},{"line_number":949,"context_line":"    for run in run_query:"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba15a1d1_f9b12848","line":946,"in_reply_to":"ba15a1d1_889c71c1","updated":"2015-09-16 15:01:50.000000000","message":"Well I don\u0027t think you can get a result where each record contains the run and the metadata. You would need somehow to transpose the metadata into columns to do that. Or you\u0027ll need to add all the metadata as a comma (or new line) separated list of key\u003dvalue as a single blob of text into an extra column in the result. It really depends on how you plan to use that metadata, but I would expect that to become a dict of metadata attached to each row (when you jsonify the result on openstack-health side.\n\nYou will need one query to get your runs, and at least another query to get all your metadata, you can then split the metadata here in the code.\n\nOr you could even not return the metadata, and let the client call two APIs, one to get all runs matching key\u003dvalue, and one to get all metadata for runs matching key\u003dvalue, and do the matching on client side.","commit_id":"d74be498fd829bc5ade11aafd27ba93476f18acf"},{"author":{"_account_id":7069,"name":"Joshua Hesketh","email":"josh@nitrotech.org","username":"jhesketh"},"change_message_id":"b7ff11917792c27120f01e0b54f537aabaecd7c9","unresolved":false,"context_lines":[{"line_number":1053,"context_line":"    runs \u003d {}"},{"line_number":1054,"context_line":"    for run in run_query:"},{"line_number":1055,"context_line":"        run_at \u003d run[5]"},{"line_number":1056,"context_line":"        run_id \u003d run[0]"},{"line_number":1057,"context_line":"        if run_at not in runs:"},{"line_number":1058,"context_line":"            # We have hit a new time stamp so we need to add a top level key"},{"line_number":1059,"context_line":"            # for the timestamp and populate the run list with a new dict for"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_55cb1753","line":1056,"updated":"2015-09-23 21:54:14.000000000","message":"(nit) you could build the run_dict here to save on code duplication","commit_id":"73dce0a86b04eec456d6469ceb28245be8965b52"},{"author":{"_account_id":1921,"name":"Andrea Frittoli","email":"andrea.frittoli@gmail.com","username":"andrea-frittoli"},"change_message_id":"133e15acca0c3b33bc99c87d14a9b986b327244d","unresolved":false,"context_lines":[{"line_number":1023,"context_line":""},{"line_number":1024,"context_line":"def get_time_series_runs_by_key_value(key, value, start_date\u003dNone,"},{"line_number":1025,"context_line":"                                      stop_date\u003dNone, session\u003dNone):"},{"line_number":1026,"context_line":"    \"\"\"Get a time series of runs with meta for all runs with a key value pai"},{"line_number":1027,"context_line":""},{"line_number":1028,"context_line":"    :param str key: the metadata key to use for matching the runs"},{"line_number":1029,"context_line":"    :param str value: the metadata value to use for matching the runs"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a1a9d01_52a183a8","line":1026,"updated":"2015-09-24 22:59:32.000000000","message":"s/pai/pair","commit_id":"2cd1b08e751e72d277f504dd5ecc673de01f4198"}]}
