)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"a55f5be3843d7911bea287efd0a0d617d5b2f77c","unresolved":true,"context_lines":[{"line_number":10,"context_line":"transaction to exist with the database which would cause issues"},{"line_number":11,"context_line":"when attempting to write to the database."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This issue has been fixed by asseming the data to return to"},{"line_number":14,"context_line":"the calling method, such that an open transaction does not"},{"line_number":15,"context_line":"remain, by copying the data retrieved from the database,"},{"line_number":16,"context_line":"thus disjointing it from the transaction."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"220e4d85_a0b528c0","line":13,"range":{"start_line":13,"start_character":29,"end_line":13,"end_character":37},"updated":"2023-07-11 21:09:06.000000000","message":"speling","commit_id":"14a048a8f75de7811ee1d020ab672fc0b88336e9"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"0739a9abad3b3f6fd210860cd425864fcaca9d66","unresolved":false,"context_lines":[{"line_number":10,"context_line":"transaction to exist with the database which would cause issues"},{"line_number":11,"context_line":"when attempting to write to the database."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"This issue has been fixed by asseming the data to return to"},{"line_number":14,"context_line":"the calling method, such that an open transaction does not"},{"line_number":15,"context_line":"remain, by copying the data retrieved from the database,"},{"line_number":16,"context_line":"thus disjointing it from the transaction."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"b04f0e14_8f0275c5","line":13,"range":{"start_line":13,"start_character":29,"end_line":13,"end_character":37},"in_reply_to":"220e4d85_a0b528c0","updated":"2023-07-11 22:26:48.000000000","message":"Done","commit_id":"14a048a8f75de7811ee1d020ab672fc0b88336e9"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":35777,"name":"Mohammed Boukhalfa","display_name":"mboukhalfa","email":"mohammed.boukhalfa@est.tech","username":"mboukhalfa"},"change_message_id":"1b58b352c96a4a20eb2e7ece4a672583e034b5de","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"5779ca28_631dcdba","updated":"2023-07-12 15:30:44.000000000","message":"LGTM","commit_id":"abad00ba42661ddd5b97353fb1f961aa014155bc"}],"ironic/db/sqlalchemy/api.py":[{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"a55f5be3843d7911bea287efd0a0d617d5b2f77c","unresolved":true,"context_lines":[{"line_number":539,"context_line":"        results \u003d _paginate_query(models.Node, limit, marker,"},{"line_number":540,"context_line":"                                  sort_key, sort_dir, query,"},{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d []"},{"line_number":545,"context_line":"        for result in results:"},{"line_number":546,"context_line":"            # right now, the result, or in this case, the row is a"},{"line_number":547,"context_line":"            # sqlalchemy.engine.row.Row class object, we need to"},{"line_number":548,"context_line":"            # extract the values."},{"line_number":549,"context_line":"            new_row \u003d []"},{"line_number":550,"context_line":"            for entry in result:"},{"line_number":551,"context_line":"                new_row.append(entry)"},{"line_number":552,"context_line":"            # We always hand back lists of tuples, by default."},{"line_number":553,"context_line":"            # As is designed for rows. ORM objects could be"},{"line_number":554,"context_line":"            # accessed via object structure, but not really"},{"line_number":555,"context_line":"            # and to do so we need to carry it on."},{"line_number":556,"context_line":"            new_result.append(tuple(new_row))"},{"line_number":557,"context_line":"        # Explicitly set results to None to free it."},{"line_number":558,"context_line":"        results \u003d None"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"0f3aa024_1d74e162","line":556,"range":{"start_line":542,"start_character":0,"end_line":556,"end_character":45},"updated":"2023-07-11 21:09:06.000000000","message":"Here is my attempt to do all this with list comprehensions\n\n  new_result \u003d list([list([tuple(row) for row in r]) for r in results])\n  \nMaybe at least the row tuple should be built with a list comprehension?","commit_id":"14a048a8f75de7811ee1d020ab672fc0b88336e9"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"7949ad7a8e07922108a9aa977ef7d55f5f44b3d3","unresolved":true,"context_lines":[{"line_number":539,"context_line":"        results \u003d _paginate_query(models.Node, limit, marker,"},{"line_number":540,"context_line":"                                  sort_key, sort_dir, query,"},{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d []"},{"line_number":545,"context_line":"        for result in results:"},{"line_number":546,"context_line":"            # right now, the result, or in this case, the row is a"},{"line_number":547,"context_line":"            # sqlalchemy.engine.row.Row class object, we need to"},{"line_number":548,"context_line":"            # extract the values."},{"line_number":549,"context_line":"            new_row \u003d []"},{"line_number":550,"context_line":"            for entry in result:"},{"line_number":551,"context_line":"                new_row.append(entry)"},{"line_number":552,"context_line":"            # We always hand back lists of tuples, by default."},{"line_number":553,"context_line":"            # As is designed for rows. ORM objects could be"},{"line_number":554,"context_line":"            # accessed via object structure, but not really"},{"line_number":555,"context_line":"            # and to do so we need to carry it on."},{"line_number":556,"context_line":"            new_result.append(tuple(new_row))"},{"line_number":557,"context_line":"        # Explicitly set results to None to free it."},{"line_number":558,"context_line":"        results \u003d None"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df9aa6a0_cbf519d8","line":556,"range":{"start_line":542,"start_character":0,"end_line":556,"end_character":45},"in_reply_to":"0f3aa024_1d74e162","updated":"2023-07-11 21:23:22.000000000","message":"so funny enough, I tried it early on, but I was likely just screwing something up.","commit_id":"14a048a8f75de7811ee1d020ab672fc0b88336e9"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"69c7f9a37f4c91f44f45311bd538416112a1d120","unresolved":false,"context_lines":[{"line_number":539,"context_line":"        results \u003d _paginate_query(models.Node, limit, marker,"},{"line_number":540,"context_line":"                                  sort_key, sort_dir, query,"},{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d []"},{"line_number":545,"context_line":"        for result in results:"},{"line_number":546,"context_line":"            # right now, the result, or in this case, the row is a"},{"line_number":547,"context_line":"            # sqlalchemy.engine.row.Row class object, we need to"},{"line_number":548,"context_line":"            # extract the values."},{"line_number":549,"context_line":"            new_row \u003d []"},{"line_number":550,"context_line":"            for entry in result:"},{"line_number":551,"context_line":"                new_row.append(entry)"},{"line_number":552,"context_line":"            # We always hand back lists of tuples, by default."},{"line_number":553,"context_line":"            # As is designed for rows. ORM objects could be"},{"line_number":554,"context_line":"            # accessed via object structure, but not really"},{"line_number":555,"context_line":"            # and to do so we need to carry it on."},{"line_number":556,"context_line":"            new_result.append(tuple(new_row))"},{"line_number":557,"context_line":"        # Explicitly set results to None to free it."},{"line_number":558,"context_line":"        results \u003d None"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"753a0fe1_0882f6d3","line":556,"range":{"start_line":542,"start_character":0,"end_line":556,"end_character":45},"in_reply_to":"df9aa6a0_cbf519d8","updated":"2023-07-11 22:12:38.000000000","message":"so the challenge is, when I clean it up, because the default ouptut from a comprehension is a list..\n\nThat being said:\n\nnew_result \u003d [tuple([ent for ent in r]) for r in results]\n\n\nSeems to do the trick!","commit_id":"14a048a8f75de7811ee1d020ab672fc0b88336e9"},{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"a55f5be3843d7911bea287efd0a0d617d5b2f77c","unresolved":true,"context_lines":[{"line_number":555,"context_line":"            # and to do so we need to carry it on."},{"line_number":556,"context_line":"            new_result.append(tuple(new_row))"},{"line_number":557,"context_line":"        # Explicitly set results to None to free it."},{"line_number":558,"context_line":"        results \u003d None"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        return new_result"},{"line_number":561,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9e9d3bb6_8cbf34c1","line":558,"updated":"2023-07-11 21:09:06.000000000","message":"oof","commit_id":"14a048a8f75de7811ee1d020ab672fc0b88336e9"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3b092ce35b0cb5c60ba3b04e6d6105165e437969","unresolved":true,"context_lines":[{"line_number":555,"context_line":"            # and to do so we need to carry it on."},{"line_number":556,"context_line":"            new_result.append(tuple(new_row))"},{"line_number":557,"context_line":"        # Explicitly set results to None to free it."},{"line_number":558,"context_line":"        results \u003d None"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        return new_result"},{"line_number":561,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"0d11fe0b_fe0338c3","line":558,"in_reply_to":"9e9d3bb6_8cbf34c1","updated":"2023-07-12 06:43:14.000000000","message":"Doing\n\n del results\n \nwould be a bit more Pythonic, by setting it to None you still rely on garbage collection implicitly.","commit_id":"14a048a8f75de7811ee1d020ab672fc0b88336e9"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"3b092ce35b0cb5c60ba3b04e6d6105165e437969","unresolved":true,"context_lines":[{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d [tuple([ent for ent in r]) for r in results]"},{"line_number":545,"context_line":"        # Explicitly set results to None to free it."},{"line_number":546,"context_line":"        results \u003d None"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"6f28ef42_ea5881ac","line":544,"updated":"2023-07-12 06:43:14.000000000","message":"nit:\n\n tuple(r)","commit_id":"47032f080decd4c33925dd52e999945ed56457e7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"d08575a467718b67162dd5e442b4e2dc58d24261","unresolved":true,"context_lines":[{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d [tuple([ent for ent in r]) for r in results]"},{"line_number":545,"context_line":"        # Explicitly set results to None to free it."},{"line_number":546,"context_line":"        results \u003d None"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"461c8e50_650c98f9","line":544,"in_reply_to":"17868115_341ebb64","updated":"2023-07-13 10:52:41.000000000","message":"\u003e And the latest test results are back, nearly 900 lock errors with just trying to tuple the row. Getting each entry seems to be the right path even if it it is a little more work.\n\nThe code I proposed is completely equivalent, except maybe Row is treated as a tuple already (it could be a subclass of it). I assume the latter given your test result.\n\nYou could definitely skip a list inside of a tuple, just a generator would work.","commit_id":"47032f080decd4c33925dd52e999945ed56457e7"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"e28fedaf13af216297b9e5557192b08d73f37294","unresolved":true,"context_lines":[{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d [tuple([ent for ent in r]) for r in results]"},{"line_number":545,"context_line":"        # Explicitly set results to None to free it."},{"line_number":546,"context_line":"        results \u003d None"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ab4540a9_0d9548b7","line":544,"in_reply_to":"6f28ef42_ea5881ac","updated":"2023-07-12 13:25:17.000000000","message":"each resulting row in the list is a tuple, not how we access it.","commit_id":"47032f080decd4c33925dd52e999945ed56457e7"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f321d52ae3431e2f6fa4b4aa788d6b52f4be9a47","unresolved":true,"context_lines":[{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d [tuple([ent for ent in r]) for r in results]"},{"line_number":545,"context_line":"        # Explicitly set results to None to free it."},{"line_number":546,"context_line":"        results \u003d None"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"17868115_341ebb64","line":544,"in_reply_to":"89c755ed_295303fa","updated":"2023-07-12 21:24:55.000000000","message":"And back to a grand total of 1 database is locked error in heartbeat processing.","commit_id":"47032f080decd4c33925dd52e999945ed56457e7"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"22c7e95d42df6616b0611a6083c4a35d4b376033","unresolved":true,"context_lines":[{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d [tuple([ent for ent in r]) for r in results]"},{"line_number":545,"context_line":"        # Explicitly set results to None to free it."},{"line_number":546,"context_line":"        results \u003d None"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"f4315f63_c750eb7a","line":544,"in_reply_to":"ab4540a9_0d9548b7","updated":"2023-07-12 13:40:58.000000000","message":"I mean\n\n results \u003d map(tuple, results)\n \nor, if you wish,\n\n results \u003d [tuple(r) for r in results]\n \n[env for ent in r] is the same as list(r), tuple(list(r)) is just tuple(r)","commit_id":"47032f080decd4c33925dd52e999945ed56457e7"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"e0f22a69cc67b344271e2f47f80d8506ecd735b4","unresolved":true,"context_lines":[{"line_number":541,"context_line":"                                  return_base_tuple\u003dTrue)"},{"line_number":542,"context_line":"        # Need to copy the data to close out the _paginate_query"},{"line_number":543,"context_line":"        # object."},{"line_number":544,"context_line":"        new_result \u003d [tuple([ent for ent in r]) for r in results]"},{"line_number":545,"context_line":"        # Explicitly set results to None to free it."},{"line_number":546,"context_line":"        results \u003d None"},{"line_number":547,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"89c755ed_295303fa","line":544,"in_reply_to":"f4315f63_c750eb7a","updated":"2023-07-12 19:06:07.000000000","message":"So each result needs to be iterated through, otherwise I believe we end up with a Row Result in each.....\n\nAnd the latest test results are back, nearly 900 lock errors with just trying to tuple the row. Getting each entry seems to be the right path even if it it is a little more work. It stille nds up on one line so hopefully as efficient as possible since we\u0027re focused on the value, not trying to carry the sqlalchemy.engine.row.Row class onward.","commit_id":"47032f080decd4c33925dd52e999945ed56457e7"}]}
