)]}'
{"gnocchi/indexer/alembic/versions/828c16f70cce_create_resource_type_table.py":[{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"6a4d6715057157b6f64f8c2f7373f8dff10df982","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        mysql_charset\u003d\u0027utf8\u0027,"},{"line_number":64,"context_line":"        mysql_engine\u003d\u0027InnoDB\u0027"},{"line_number":65,"context_line":"    )"},{"line_number":66,"context_line":"    op.create_index(\u0027ix_resource_type_name\u0027, \u0027resource_type\u0027, [\u0027name\u0027],"},{"line_number":67,"context_line":"                    unique\u003dFalse)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    resource \u003d sa.Table(\u0027resource\u0027, sa.MetaData(),"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_e068d2f7","line":66,"updated":"2016-02-03 19:35:27.000000000","message":"don\u0027t all dbs index the primary key by default? i\u0027m pretty sure postgres and mysql do.","commit_id":"ea8280703ccc526c80275373e74d02999bf4c291"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"dc286021c779d324c5201cc590ede0e93e83c653","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        mysql_charset\u003d\u0027utf8\u0027,"},{"line_number":64,"context_line":"        mysql_engine\u003d\u0027InnoDB\u0027"},{"line_number":65,"context_line":"    )"},{"line_number":66,"context_line":"    op.create_index(\u0027ix_resource_type_name\u0027, \u0027resource_type\u0027, [\u0027name\u0027],"},{"line_number":67,"context_line":"                    unique\u003dFalse)"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    resource \u003d sa.Table(\u0027resource\u0027, sa.MetaData(),"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_2f06c0ce","line":66,"in_reply_to":"5a5ae5dd_e068d2f7","updated":"2016-02-04 09:19:36.000000000","message":"Well catched, I follow the same construction schema of other tables, and all have the issues.\n\nI have removed that and proposed an other patch to fix others tables.","commit_id":"ea8280703ccc526c80275373e74d02999bf4c291"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"6a4d6715057157b6f64f8c2f7373f8dff10df982","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        op.add_column(table, type_string_col(\"type\", table))"},{"line_number":78,"context_line":"        sa_table \u003d sa.Table(table, sa.MetaData(),"},{"line_number":79,"context_line":"                            type_string_col(\"type\", table),"},{"line_number":80,"context_line":"                            type_enum_col(\u0027old_type\u0027))"},{"line_number":81,"context_line":"        op.execute(sa_table.update().values("},{"line_number":82,"context_line":"            {sa_table.c.type: sa_table.c.old_type}))"},{"line_number":83,"context_line":"        op.drop_column(table, \"old_type\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_ebe7533e","line":80,"updated":"2016-02-03 19:35:27.000000000","message":"just curious, why don\u0027t we use auto_load instead of listing out columns?","commit_id":"ea8280703ccc526c80275373e74d02999bf4c291"},{"author":{"_account_id":6537,"name":"gordon chung","email":"gord@live.ca","username":"chungg"},"change_message_id":"d0e2317542c8fa217cf4ba9eedc3de043644c1c1","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        op.add_column(table, type_string_col(\"type\", table))"},{"line_number":78,"context_line":"        sa_table \u003d sa.Table(table, sa.MetaData(),"},{"line_number":79,"context_line":"                            type_string_col(\"type\", table),"},{"line_number":80,"context_line":"                            type_enum_col(\u0027old_type\u0027))"},{"line_number":81,"context_line":"        op.execute(sa_table.update().values("},{"line_number":82,"context_line":"            {sa_table.c.type: sa_table.c.old_type}))"},{"line_number":83,"context_line":"        op.drop_column(table, \"old_type\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_89479e1c","line":80,"in_reply_to":"5a5ae5dd_6a2fc6f6","updated":"2016-02-04 13:20:07.000000000","message":"ah i see. good to know. i will try to remember that.","commit_id":"ea8280703ccc526c80275373e74d02999bf4c291"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"dc286021c779d324c5201cc590ede0e93e83c653","unresolved":false,"context_lines":[{"line_number":77,"context_line":"        op.add_column(table, type_string_col(\"type\", table))"},{"line_number":78,"context_line":"        sa_table \u003d sa.Table(table, sa.MetaData(),"},{"line_number":79,"context_line":"                            type_string_col(\"type\", table),"},{"line_number":80,"context_line":"                            type_enum_col(\u0027old_type\u0027))"},{"line_number":81,"context_line":"        op.execute(sa_table.update().values("},{"line_number":82,"context_line":"            {sa_table.c.type: sa_table.c.old_type}))"},{"line_number":83,"context_line":"        op.drop_column(table, \"old_type\")"}],"source_content_type":"text/x-python","patch_set":15,"id":"5a5ae5dd_6a2fc6f6","line":80,"in_reply_to":"5a5ae5dd_ebe7533e","updated":"2016-02-04 09:19:36.000000000","message":"using autoload means using op.get_bind() to pass the sqlalchemy engine to the Metadata().\n\nusing op.get_bind() means alembic can\u0027t generate an offline script for this migration script. So when it\u0027s easy to avoid it, I do. If they are another way to use autoload without op.get_bind(), I will be happy to use it.","commit_id":"ea8280703ccc526c80275373e74d02999bf4c291"}],"gnocchi/indexer/sqlalchemy.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"2fd8c66b58082ad0688e45e367564ba047b2f03c","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                session.flush()"},{"line_number":115,"context_line":"            except exception.DBDuplicateEntry:"},{"line_number":116,"context_line":"                pass"},{"line_number":117,"context_line":"            session.expunge_all()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def _resource_type_to_class(self, resource_type, purpose\u003d\"resource\"):"},{"line_number":120,"context_line":"        if resource_type not in self._RESOURCE_CLASS_MAPPER:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_bec66d47","line":117,"updated":"2016-01-21 13:01:15.000000000","message":"Why do you need to expunge_all() here?","commit_id":"5b835cac4f123f1dda6ad12076b1ede55eec96a2"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"9493ce7e5d894bc2c8fe7ff8ec613dadac1cc4d0","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                session.flush()"},{"line_number":115,"context_line":"            except exception.DBDuplicateEntry:"},{"line_number":116,"context_line":"                pass"},{"line_number":117,"context_line":"            session.expunge_all()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def _resource_type_to_class(self, resource_type, purpose\u003d\"resource\"):"},{"line_number":120,"context_line":"        if resource_type not in self._RESOURCE_CLASS_MAPPER:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_049dec58","line":117,"in_reply_to":"9a68dd71_bec66d47","updated":"2016-01-21 13:39:10.000000000","message":"Indentation issue, that should be called only one time. Next iteration will fix this.","commit_id":"5b835cac4f123f1dda6ad12076b1ede55eec96a2"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"7f6b27e2a415cb3732d0b571c0cfb15f79a60dd1","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                session.flush()"},{"line_number":115,"context_line":"            except exception.DBDuplicateEntry:"},{"line_number":116,"context_line":"                pass"},{"line_number":117,"context_line":"            session.expunge_all()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def _resource_type_to_class(self, resource_type, purpose\u003d\"resource\"):"},{"line_number":120,"context_line":"        if resource_type not in self._RESOURCE_CLASS_MAPPER:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_f809582d","line":117,"updated":"2016-01-21 13:46:17.000000000","message":"I still don\u0027t get why you need that. :)","commit_id":"af00b8b8255f7011b96f3569228a10cead3bb17d"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"312fd81fc88782e7bbc49b5dfc9ef6000a7ae7ce","unresolved":false,"context_lines":[{"line_number":114,"context_line":"                session.flush()"},{"line_number":115,"context_line":"            except exception.DBDuplicateEntry:"},{"line_number":116,"context_line":"                pass"},{"line_number":117,"context_line":"            session.expunge_all()"},{"line_number":118,"context_line":""},{"line_number":119,"context_line":"    def _resource_type_to_class(self, resource_type, purpose\u003d\"resource\"):"},{"line_number":120,"context_line":"        if resource_type not in self._RESOURCE_CLASS_MAPPER:"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a68dd71_58d42446","line":117,"in_reply_to":"9a68dd71_f809582d","updated":"2016-01-21 13:50:53.000000000","message":"I don\u0027t known too ;), I will remove it.","commit_id":"af00b8b8255f7011b96f3569228a10cead3bb17d"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"40dab365fad1e0c45dc25980995974ad93f6b476","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            try:"},{"line_number":114,"context_line":"                session.flush()"},{"line_number":115,"context_line":"            except exception.DBDuplicateEntry:"},{"line_number":116,"context_line":"                pass"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _resource_type_to_class(self, resource_type, purpose\u003d\"resource\"):"},{"line_number":119,"context_line":"        if resource_type not in self._RESOURCE_CLASS_MAPPER:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_9119177c","line":116,"updated":"2016-01-21 14:32:08.000000000","message":"Best thing would to actually try/except the whole block and use with session.begin(); that would avoid flushing a lot of time.","commit_id":"07605a52d743bb0b72cb7f5edd305b3facc412b3"},{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"6f58f7128854c647a857041df5d84c9f4c58e242","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            try:"},{"line_number":114,"context_line":"                session.flush()"},{"line_number":115,"context_line":"            except exception.DBDuplicateEntry:"},{"line_number":116,"context_line":"                pass"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _resource_type_to_class(self, resource_type, purpose\u003d\"resource\"):"},{"line_number":119,"context_line":"        if resource_type not in self._RESOURCE_CLASS_MAPPER:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_6c64ca48","line":116,"in_reply_to":"9a68dd71_714a63c7","updated":"2016-01-21 14:56:21.000000000","message":"Oh right… yeah ok, my bad!","commit_id":"07605a52d743bb0b72cb7f5edd305b3facc412b3"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"db336645c2f006bdf940540af8d168c9b92e03f3","unresolved":false,"context_lines":[{"line_number":113,"context_line":"            try:"},{"line_number":114,"context_line":"                session.flush()"},{"line_number":115,"context_line":"            except exception.DBDuplicateEntry:"},{"line_number":116,"context_line":"                pass"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _resource_type_to_class(self, resource_type, purpose\u003d\"resource\"):"},{"line_number":119,"context_line":"        if resource_type not in self._RESOURCE_CLASS_MAPPER:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a68dd71_714a63c7","line":116,"in_reply_to":"9a68dd71_9119177c","updated":"2016-01-21 14:41:32.000000000","message":"I flush everytime to ensure each resource type are created. But yeah, in theories if one of them exists, all of them should there.","commit_id":"07605a52d743bb0b72cb7f5edd305b3facc412b3"}],"gnocchi/indexer/sqlalchemy_base.py":[{"author":{"_account_id":1669,"name":"Julien Danjou","display_name":"jd","email":"julien@danjou.info","username":"jdanjou"},"change_message_id":"2fd8c66b58082ad0688e45e367564ba047b2f03c","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                COMMON_TABLES_ARGS)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    @declarative.declared_attr"},{"line_number":235,"context_line":"    def type(cls):"},{"line_number":236,"context_line":"        return sqlalchemy.Column("},{"line_number":237,"context_line":"            sqlalchemy.String(255),"},{"line_number":238,"context_line":"            sqlalchemy.ForeignKey(\u0027resource_type.name\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_3e083d91","line":235,"updated":"2016-01-21 13:01:15.000000000","message":"Ok, I just miss why you have to go through declared_attr. Can you enlighten me?","commit_id":"5b835cac4f123f1dda6ad12076b1ede55eec96a2"},{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"9493ce7e5d894bc2c8fe7ff8ec613dadac1cc4d0","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                COMMON_TABLES_ARGS)"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    @declarative.declared_attr"},{"line_number":235,"context_line":"    def type(cls):"},{"line_number":236,"context_line":"        return sqlalchemy.Column("},{"line_number":237,"context_line":"            sqlalchemy.String(255),"},{"line_number":238,"context_line":"            sqlalchemy.ForeignKey(\u0027resource_type.name\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_e4b458f3","line":235,"in_reply_to":"9a68dd71_3e083d91","updated":"2016-01-21 13:39:10.000000000","message":"Before it was just a static list, now this is a foreign key to another table (resource or resource_history). Because this is a Mixin and we can\u0027t put the tablename statically. This have to be a method to be able to use cls.__tablename__.\n\nAnd a method that returns column to map with sqlalchemy have to be \"declared_attr\".","commit_id":"5b835cac4f123f1dda6ad12076b1ede55eec96a2"}]}
