)]}'
{"oslo_db/sqlalchemy/types.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"fec58ed371492ed9eb48d541cee7104b734833f7","unresolved":false,"context_lines":[{"line_number":40,"context_line":""},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"class JSONEncodedDict(JsonEncodedType):"},{"line_number":43,"context_line":"    \"\"\"Represents dict serialized as json-encoded string in db.\"\"\""},{"line_number":44,"context_line":"    type \u003d dict"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_5a016b38","line":43,"updated":"2015-07-31 13:35:15.000000000","message":"nit: let\u0027s add an explicit note this class doesn\u0027t support mutation tracking - http://docs.sqlalchemy.org/en/rel_1_0/orm/extensions/mutable.html - and mention SQLAlchemy docs on how to actually enable it","commit_id":"68f5a00bef2fa33278df913ceea2eac9062dc5c6"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"afdc49a3590125ebc68dd67150785f8b2ede0770","unresolved":false,"context_lines":[{"line_number":18,"context_line":"class JsonEncodedType(TypeDecorator):"},{"line_number":19,"context_line":"    \"\"\"Abstract base type serialized as json-encoded string in db.\"\"\""},{"line_number":20,"context_line":"    type \u003d None"},{"line_number":21,"context_line":"    impl \u003d TEXT"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"    def process_bind_param(self, value, dialect):"},{"line_number":24,"context_line":"        if value is None:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_271b18cc","line":21,"updated":"2015-07-31 18:50:27.000000000","message":"This should be `Text` or even `UnicodeText` (do we have any non-ascii json data?).   `TEXT` isn\u0027t necessarily available on every platform.","commit_id":"c82b0ab840c7b6d48fd651a8bd7f80dcba1e9347"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"afdc49a3590125ebc68dd67150785f8b2ede0770","unresolved":false,"context_lines":[{"line_number":24,"context_line":"        if value is None:"},{"line_number":25,"context_line":"            # Save default value according to current type to keep the"},{"line_number":26,"context_line":"            # interface the consistent."},{"line_number":27,"context_line":"            value \u003d self.type()"},{"line_number":28,"context_line":"        elif not isinstance(value, self.type):"},{"line_number":29,"context_line":"            raise TypeError(\"%s supposes to store %s objects, but %s given\""},{"line_number":30,"context_line":"                            % (self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_87b30c0a","line":27,"updated":"2015-07-31 18:50:27.000000000","message":"this should either raise NotImplementedError if called on JsonEncodedType itself, or skip using \"type\" if its None.\n\nAlso, this makes it hard to store SQL NULL.  It sort of depends on use case if folks want NULLs to be storable or not.  SQLAlchemy has to deal with it like this: http://docs.sqlalchemy.org/en/rel_1_0/dialects/postgresql.html?highlight\u003djson#sqlalchemy.dialects.postgresql.JSON.__init__","commit_id":"c82b0ab840c7b6d48fd651a8bd7f80dcba1e9347"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"a2a1795faca5432f32a7bf884c03db08e3a9ac5a","unresolved":false,"context_lines":[{"line_number":24,"context_line":"        if value is None:"},{"line_number":25,"context_line":"            # Save default value according to current type to keep the"},{"line_number":26,"context_line":"            # interface the consistent."},{"line_number":27,"context_line":"            value \u003d self.type()"},{"line_number":28,"context_line":"        elif not isinstance(value, self.type):"},{"line_number":29,"context_line":"            raise TypeError(\"%s supposes to store %s objects, but %s given\""},{"line_number":30,"context_line":"                            % (self.__class__.__name__,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_c41d6474","line":27,"in_reply_to":"3a50d1a3_87b30c0a","updated":"2015-08-03 08:26:39.000000000","message":"well, ironic expects this field to be never null for child classes (dict and list), so I\u0027d prefer to leave it the same way. However, this base class will work with None, I\u0027ll fix it.","commit_id":"c82b0ab840c7b6d48fd651a8bd7f80dcba1e9347"}],"oslo_db/tests/sqlalchemy/test_types.py":[{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"fec58ed371492ed9eb48d541cee7104b734833f7","unresolved":false,"context_lines":[{"line_number":10,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":11,"context_line":"#    under the License."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"\"\"\"Tests for custom SQLAlchemy types via Ironic DB.\"\"\""},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from sqlalchemy import Column, Integer, MetaData, Table"},{"line_number":16,"context_line":"from sqlalchemy.ext.declarative import declarative_base"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_7a71c7dd","line":13,"updated":"2015-07-31 13:35:15.000000000","message":"nit: let\u0027s remove Ironic from here :)","commit_id":"68f5a00bef2fa33278df913ceea2eac9062dc5c6"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"fec58ed371492ed9eb48d541cee7104b734833f7","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        )"},{"line_number":45,"context_line":"        self.test_table.create(self.engine)"},{"line_number":46,"context_line":"        self.addCleanup(self.test_table.drop, self.engine)"},{"line_number":47,"context_line":"        self.session \u003d self.sessionmaker()"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_default_value(self):"},{"line_number":50,"context_line":"        with self.session.begin():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a50d1a3_1a1f63b8","line":47,"updated":"2015-07-31 13:35:15.000000000","message":"nit: let\u0027s also add\n\n  self.addCleanup(self.session.close)\n\nto make sure all connections are properly returned to pool","commit_id":"68f5a00bef2fa33278df913ceea2eac9062dc5c6"},{"author":{"_account_id":11816,"name":"mike bayer","display_name":"Mike Bayer","email":"mike_mp@zzzcomputing.com","username":"zzzeek","status":"Red Hat"},"change_message_id":"afdc49a3590125ebc68dd67150785f8b2ede0770","unresolved":false,"context_lines":[{"line_number":36,"context_line":"        super(JSONTypesTestCase, self).setUp()"},{"line_number":37,"context_line":"        meta \u003d MetaData()"},{"line_number":38,"context_line":"        meta.bind \u003d self.engine"},{"line_number":39,"context_line":"        self.test_table \u003d Table("},{"line_number":40,"context_line":"            \"test_json_types\", meta,"},{"line_number":41,"context_line":"            Column(\u0027id\u0027, Integer, primary_key\u003dTrue),"},{"line_number":42,"context_line":"            Column(\u0027jdict\u0027, types.JSONEncodedDict()),"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a50d1a3_07585c55","line":39,"updated":"2015-07-31 18:50:27.000000000","message":"I know other tests do this but it\u0027s not necessary to make a Table and a separate JsonTable model.   your test_table is simply JsonTable.__table__.  It\u0027s already there.","commit_id":"c82b0ab840c7b6d48fd651a8bd7f80dcba1e9347"}]}
