)]}'
{"oslo_db/sqlalchemy/utils.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"5b3d5f4a64687a378f371d52054dfe9756a65bd5","unresolved":false,"context_lines":[{"line_number":1168,"context_line":"    return [i[0] for i in nonndbcluster]"},{"line_number":1169,"context_line":""},{"line_number":1170,"context_line":""},{"line_number":1171,"context_line":"def get_fk_name(inspector, table, fk_column):"},{"line_number":1172,"context_line":"    \"\"\"Find the name of foreign key in a table."},{"line_number":1173,"context_line":""},{"line_number":1174,"context_line":"    This will use the inspecter object on a given table and column with"}],"source_content_type":"text/x-python","patch_set":1,"id":"9f436f4f_ca8c2b81","line":1171,"updated":"2017-08-09 21:47:00.000000000","message":"how about:\n\n    get_fk_name_for_constrained_column(inspector, table_name, column_name)","commit_id":"13f833fab3a5baba488306ebaa882989106b47bc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1c727846f9d6d268e9ec40a272449121ee750bc1","unresolved":false,"context_lines":[{"line_number":1116,"context_line":""},{"line_number":1117,"context_line":"    :param connectable: a SQLAlchemy Engine or a Connection instance"},{"line_number":1118,"context_line":"    :param skip_tables: a list of tables which might have a different"},{"line_number":1119,"context_line":"                        storage engine"},{"line_number":1120,"context_line":"    \"\"\""},{"line_number":1121,"context_line":"    query_str \u003d \"\"\""},{"line_number":1122,"context_line":"        SELECT table_name"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_1cd71952","line":1119,"updated":"2017-08-21 06:51:28.000000000","message":"Just a quick reminder, try to keep style-only changes like the above to separate patches that are marked style-only. It helps reviewers since, absent any indication that the above is style-only/whitespace-change-only, we need to go through each line meticulously assuming that there\u0027s been a functional change or a change to comments specific to the patch in question.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1c727846f9d6d268e9ec40a272449121ee750bc1","unresolved":false,"context_lines":[{"line_number":1216,"context_line":"     and recreated."},{"line_number":1217,"context_line":""},{"line_number":1218,"context_line":"    :param referents: sequence of string table names to search for foreign"},{"line_number":1219,"context_line":"     key constraints.   A future version of this function may no longer"},{"line_number":1220,"context_line":"     require this argument, however for the moment it is required."},{"line_number":1221,"context_line":""},{"line_number":1222,"context_line":"    :param all_backends: indicates the operation should proceed on all"},{"line_number":1223,"context_line":"     backends unconditionally.   If left at default of False, the"}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_5c112104","line":1220,"range":{"start_line":1219,"start_character":21,"end_line":1220,"end_character":66},"updated":"2017-08-21 06:51:28.000000000","message":"This is odd :) Can you elaborate on what you\u0027re thinking about for future versions of this function? Would you somehow gather referents from the schema automatically?","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"09f7dde151505553b53086d18e55c248bfd59625","unresolved":false,"context_lines":[{"line_number":1216,"context_line":"     and recreated."},{"line_number":1217,"context_line":""},{"line_number":1218,"context_line":"    :param referents: sequence of string table names to search for foreign"},{"line_number":1219,"context_line":"     key constraints.   A future version of this function may no longer"},{"line_number":1220,"context_line":"     require this argument, however for the moment it is required."},{"line_number":1221,"context_line":""},{"line_number":1222,"context_line":"    :param all_backends: indicates the operation should proceed on all"},{"line_number":1223,"context_line":"     backends unconditionally.   If left at default of False, the"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_87eb63da","line":1220,"range":{"start_line":1219,"start_character":21,"end_line":1220,"end_character":66},"in_reply_to":"9f436f4f_5c112104","updated":"2017-08-28 14:11:16.000000000","message":"that is the idea yes.  SQLAlchemy right now only knows how to grab the foreign key constraints from the table upon which they are declared.   So in this case if you were to say load every table in the DB and search, you could do it that way.  But in all liklihood it would just stay this way so we can remove that comment if you\u0027d like.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1c727846f9d6d268e9ec40a272449121ee750bc1","unresolved":false,"context_lines":[{"line_number":1219,"context_line":"     key constraints.   A future version of this function may no longer"},{"line_number":1220,"context_line":"     require this argument, however for the moment it is required."},{"line_number":1221,"context_line":""},{"line_number":1222,"context_line":"    :param all_backends: indicates the operation should proceed on all"},{"line_number":1223,"context_line":"     backends unconditionally.   If left at default of False, the"},{"line_number":1224,"context_line":"     drop/recreate operation only runs on backends that do not allow"},{"line_number":1225,"context_line":"     a simple ALTER with foreign key constraints in place (e.g. NDB)."}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_3c21bd4e","line":1222,"range":{"start_line":1222,"start_character":11,"end_line":1222,"end_character":23},"updated":"2017-08-21 06:51:28.000000000","message":"Suggest renaming this parameter to better indicate what exactly it\u0027s doing. For instance, how about naming it \"only_in_place_alter\" and making the default True? That would be more indicative of what the parameter is actually preventing.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"2cea15ea9158834d97af151aefbabfc3c4785387","unresolved":false,"context_lines":[{"line_number":1219,"context_line":"     key constraints.   A future version of this function may no longer"},{"line_number":1220,"context_line":"     require this argument, however for the moment it is required."},{"line_number":1221,"context_line":""},{"line_number":1222,"context_line":"    :param all_backends: indicates the operation should proceed on all"},{"line_number":1223,"context_line":"     backends unconditionally.   If left at default of False, the"},{"line_number":1224,"context_line":"     drop/recreate operation only runs on backends that do not allow"},{"line_number":1225,"context_line":"     a simple ALTER with foreign key constraints in place (e.g. NDB)."}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_ba249f0e","line":1222,"range":{"start_line":1222,"start_character":11,"end_line":1222,"end_character":23},"in_reply_to":"9f436f4f_3c21bd4e","updated":"2017-08-23 19:38:49.000000000","message":"I think the \"all_backends\" makes sense because the determination on if you want it to run is dependent upon the database backend. \"only_in_place_alter\" seems a bit more ambiguous.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1c727846f9d6d268e9ec40a272449121ee750bc1","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"     As recreating foreign key constraints implies the full contents of the"},{"line_number":1227,"context_line":"     table must be re-scanned, and additionally may mean the recreation"},{"line_number":1228,"context_line":"     of indexes in MySQL, the operation may perform poorly for large tables"},{"line_number":1229,"context_line":"     if this flag is enabled."},{"line_number":1230,"context_line":""},{"line_number":1231,"context_line":"    \"\"\""},{"line_number":1232,"context_line":"    if ("}],"source_content_type":"text/x-python","patch_set":5,"id":"9f436f4f_dc1511e7","line":1229,"range":{"start_line":1229,"start_character":21,"end_line":1229,"end_character":28},"updated":"2017-08-21 06:51:28.000000000","message":"if you go with my suggestion above, this would be \"disabled\"","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2a4d194f6d10df2769d5c7cac7ea748aea2dc644","unresolved":false,"context_lines":[{"line_number":1232,"context_line":"    if ("},{"line_number":1233,"context_line":"        not all_backends and ("},{"line_number":1234,"context_line":"            not ndb.ndb_status(engine)"},{"line_number":1235,"context_line":"        )"},{"line_number":1236,"context_line":"    ):"},{"line_number":1237,"context_line":"        yield"},{"line_number":1238,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_807474ff","line":1235,"updated":"2017-08-28 09:02:15.000000000","message":"Honestly, the whole all_backends flag is just unnecessary. Since this is just a workaround for NDB at the moment, I see no reason not to just make the above:\n\n if not ndb.db_status(engine):\n     yield\n\nand remove the\n\n else:\n\nbelow and de-indent one level.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"09f7dde151505553b53086d18e55c248bfd59625","unresolved":false,"context_lines":[{"line_number":1232,"context_line":"    if ("},{"line_number":1233,"context_line":"        not all_backends and ("},{"line_number":1234,"context_line":"            not ndb.ndb_status(engine)"},{"line_number":1235,"context_line":"        )"},{"line_number":1236,"context_line":"    ):"},{"line_number":1237,"context_line":"        yield"},{"line_number":1238,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_871c83c1","line":1235,"in_reply_to":"7f287b81_807474ff","updated":"2017-08-28 14:11:16.000000000","message":"OK if you want to make this *only* NDB (and potential future backends with similar restrictions) then the whole name of the function should change to reflect that since it seems to say it\u0027s going to do something, and in the vast majority of cases, it isn\u0027t going to do anything at all.   we\u0027d need to call it \"guard_for_backend_col_change_conditions()\" or something like that, and we probably should do that anyway.  \n\nNote that there are likely ways to make this whole thing more transparent as a configurable event invoked from the Alembic side (still coded here as far as what it would do), but unfortunately lots of projects are still using sqlalchemy-migrate so the idea here was to make it compatible with those as well.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"9629c22b4449ed1ee1bd773f19fa59df786c6214","unresolved":false,"context_lines":[{"line_number":1232,"context_line":"    if ("},{"line_number":1233,"context_line":"        not all_backends and ("},{"line_number":1234,"context_line":"            not ndb.ndb_status(engine)"},{"line_number":1235,"context_line":"        )"},{"line_number":1236,"context_line":"    ):"},{"line_number":1237,"context_line":"        yield"},{"line_number":1238,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_e2ffb2a8","line":1235,"in_reply_to":"7f287b81_82eeb1b1","updated":"2017-08-28 16:15:54.000000000","message":"I still think the current name is very clear on what this function does. \"guard_constraints\" sounds a bit ambiguous and implies that it\u0027s guarding something, which it isn\u0027t. The function recreates the keys with some basic intelligence as a helper so that the developer doesn\u0027t have to do all of the operations manually. That was the whole point of this function.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"52cc59c9df99141deb4ac78d2278f7b8d4b94ba4","unresolved":false,"context_lines":[{"line_number":1232,"context_line":"    if ("},{"line_number":1233,"context_line":"        not all_backends and ("},{"line_number":1234,"context_line":"            not ndb.ndb_status(engine)"},{"line_number":1235,"context_line":"        )"},{"line_number":1236,"context_line":"    ):"},{"line_number":1237,"context_line":"        yield"},{"line_number":1238,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_82eeb1b1","line":1235,"in_reply_to":"7f287b81_871c83c1","updated":"2017-08-28 14:40:37.000000000","message":"How about guard_constraints(), so:\n\n with guard_constraints(...):\n    // do some operations","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"048aca42785007b0bb37962f6d55bfedba6d16b4","unresolved":false,"context_lines":[{"line_number":1232,"context_line":"    if ("},{"line_number":1233,"context_line":"        not all_backends and ("},{"line_number":1234,"context_line":"            not ndb.ndb_status(engine)"},{"line_number":1235,"context_line":"        )"},{"line_number":1236,"context_line":"    ):"},{"line_number":1237,"context_line":"        yield"},{"line_number":1238,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_f99cf9c0","line":1235,"in_reply_to":"7f287b81_e2ffb2a8","updated":"2017-08-29 08:09:19.000000000","message":"This is guarding schema alter operations from blowing up on NDB because NDB requires the constraints to be dropped and recreated if any of the columns being altered are involved in those constraints.\n\nSo, come up with a name that represents that :)","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"21efa4b095c65feedc52f475942d5135bb36b9a9","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"            for fk in fks:"},{"line_number":1256,"context_line":"                op.drop_constraint("},{"line_number":1257,"context_line":"                    fk[\u0027name\u0027], fk[\u0027source_table\u0027], type_\u003d\"foreignkey\")"},{"line_number":1258,"context_line":"            yield"},{"line_number":1259,"context_line":"            for fk in fks:"},{"line_number":1260,"context_line":"                op.create_foreign_key("},{"line_number":1261,"context_line":"                    fk[\u0027name\u0027], fk[\u0027source_table\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_6d49912f","line":1258,"updated":"2017-08-26 10:32:57.000000000","message":"Octave, another thing I thought about just now... what if the operation being performed inside the context manager changes the definition of the table with respect to the foreign keys on it? Wouldn\u0027t that mean lines 1259-1263 would error out with a duplicate constraint name failure?","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"81b5458c6caeb5f78bcd5ecc2a899ee8eb3c0037","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"            for fk in fks:"},{"line_number":1256,"context_line":"                op.drop_constraint("},{"line_number":1257,"context_line":"                    fk[\u0027name\u0027], fk[\u0027source_table\u0027], type_\u003d\"foreignkey\")"},{"line_number":1258,"context_line":"            yield"},{"line_number":1259,"context_line":"            for fk in fks:"},{"line_number":1260,"context_line":"                op.create_foreign_key("},{"line_number":1261,"context_line":"                    fk[\u0027name\u0027], fk[\u0027source_table\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_b3a7da0b","line":1258,"in_reply_to":"7f287b81_33308ae8","updated":"2017-08-26 15:14:48.000000000","message":"@zzzeek: k. what is your opinion regarding the parameter name I commented on above?","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"c3a8eb6f4b55ff477eb91b9e6c8318c382bd9d3f","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"            for fk in fks:"},{"line_number":1256,"context_line":"                op.drop_constraint("},{"line_number":1257,"context_line":"                    fk[\u0027name\u0027], fk[\u0027source_table\u0027], type_\u003d\"foreignkey\")"},{"line_number":1258,"context_line":"            yield"},{"line_number":1259,"context_line":"            for fk in fks:"},{"line_number":1260,"context_line":"                op.create_foreign_key("},{"line_number":1261,"context_line":"                    fk[\u0027name\u0027], fk[\u0027source_table\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f287b81_33308ae8","line":1258,"in_reply_to":"7f287b81_6d49912f","updated":"2017-08-26 15:01:26.000000000","message":"you\u0027d have to ensure that the context manager is used judiciously in this regard, in that you\u0027re just putting column type / nullable modifications within it and not dropping columns or renaming them.    (another example of how the feature would work really badly if generalized to alembic! :) ).   If we do need to support column renames and other things then I\u0027d propose we add more arguments to the helper here to specify that.\n\nThe purpose of this helper is strictly to reduce the verbosity of writing out DROP/CREATE and foreign key inspection instructions all throughout each column operation.    Literally, the main purpose here is to automate the collection of target constraints, working them into new CREATE definitions, then dropping/recreating.   It can be as explicit about intent as it needs to be.","commit_id":"ac7d144169375b925b4d7b251c5ea671d8932983"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0691581e1ba0027f30353e05fdcc39877a2ce9eb","unresolved":false,"context_lines":[{"line_number":1180,"context_line":"     key constraints.   A future version of this function may no longer"},{"line_number":1181,"context_line":"     require this argument, however for the moment it is required."},{"line_number":1182,"context_line":""},{"line_number":1183,"context_line":"    :param all_backends: indicates the operation should proceed on all"},{"line_number":1184,"context_line":"     backends unconditionally.   If left at default of False, the"},{"line_number":1185,"context_line":"     drop/recreate operation only runs on backends that do not allow"},{"line_number":1186,"context_line":"     a simple ALTER with foreign key constraints in place (e.g. NDB)."}],"source_content_type":"text/x-python","patch_set":7,"id":"5f2577a7_abe77c12","line":1183,"updated":"2017-09-13 17:19:55.000000000","message":"this is no longer a parameter. Please remove.","commit_id":"efa7567e634cfc5138f5742926cf56497e430dd8"}],"oslo_db/tests/sqlalchemy/test_utils.py":[{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"e419c7aa92c717e014658f7b273af28f8fbda861","unresolved":false,"context_lines":[{"line_number":886,"context_line":"        self.assertRaises(exception.DBError, self.conn.execute,"},{"line_number":887,"context_line":"                          insert_statement)"},{"line_number":888,"context_line":""},{"line_number":889,"context_line":"        def test_get_foreign_key_constraint_name(self):"},{"line_number":890,"context_line":"            inspector \u003d reflection.Inspector.from_engine(self.engine)"},{"line_number":891,"context_line":"            table_1 \u003d Table(\u0027table_name_1\u0027, self.meta,"},{"line_number":892,"context_line":"                            Column(\u0027id\u0027, Integer, primary_key\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_692e0093","line":889,"updated":"2017-08-14 19:50:03.000000000","message":"this test is not even running because it\u0027s indented","commit_id":"46cd03f872e1342c078e663d5c5961bdc89a17d9"},{"author":{"_account_id":19283,"name":"Octave Orgeron","email":"octave.orgeron@oracle.com","username":"oorgeron"},"change_message_id":"5e7edb234eebed286fbaf85fc121b9127cb8d1af","unresolved":false,"context_lines":[{"line_number":886,"context_line":"        self.assertRaises(exception.DBError, self.conn.execute,"},{"line_number":887,"context_line":"                          insert_statement)"},{"line_number":888,"context_line":""},{"line_number":889,"context_line":"        def test_get_foreign_key_constraint_name(self):"},{"line_number":890,"context_line":"            inspector \u003d reflection.Inspector.from_engine(self.engine)"},{"line_number":891,"context_line":"            table_1 \u003d Table(\u0027table_name_1\u0027, self.meta,"},{"line_number":892,"context_line":"                            Column(\u0027id\u0027, Integer, primary_key\u003dTrue),"}],"source_content_type":"text/x-python","patch_set":2,"id":"9f436f4f_496d7cca","line":889,"in_reply_to":"9f436f4f_692e0093","updated":"2017-08-14 19:52:46.000000000","message":"Ugh.. what a dumb mistake on my part. I can fix this and repost or do you want to fix while adding the other helper functions?","commit_id":"46cd03f872e1342c078e663d5c5961bdc89a17d9"}]}
