)]}'
{"oslo_versionedobjects/base.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"410c4363d10c044f5b28d466ddbb86e19713a51d","unresolved":false,"context_lines":[{"line_number":796,"context_line":""},{"line_number":797,"context_line":""},{"line_number":798,"context_line":"class EphemeralObject(object):"},{"line_number":799,"context_line":"    \"\"\"Mix-in to provide more recognizeable field defaulting."},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    If an object should have all fields with a default\u003d set to"},{"line_number":802,"context_line":"    those values during instantiation, inherit from this class."}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_76e311a1","line":799,"range":{"start_line":799,"start_character":30,"end_line":799,"end_character":43},"updated":"2020-01-09 22:28:16.000000000","message":"recognizable","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0dc2ca4ae09da6c9006ae36a1e10c740e1245f45","unresolved":false,"context_lines":[{"line_number":798,"context_line":"class EphemeralObject(object):"},{"line_number":799,"context_line":"    \"\"\"Mix-in to provide more recognizeable field defaulting."},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    If an object should have all fields with a default\u003d set to"},{"line_number":802,"context_line":"    those values during instantiation, inherit from this class."},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    The base VersionedObject class is designed in such a way that all"},{"line_number":805,"context_line":"    fields are optional, which makes sense when representing a remote"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_868c582e","line":802,"range":{"start_line":801,"start_character":0,"end_line":802,"end_character":63},"updated":"2020-01-10 11:30:50.000000000","message":"I might add that fields without value provided at __init__ and without default value will be left uninitialized by this mixing.\n\nAs an alternative behavior for these fields would be that the __init__ raises if such field exists to avoid non initialized fields after __init__.","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d00942319c6faa75378c2b343862faeb6ddc37c5","unresolved":false,"context_lines":[{"line_number":798,"context_line":"class EphemeralObject(object):"},{"line_number":799,"context_line":"    \"\"\"Mix-in to provide more recognizeable field defaulting."},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    If an object should have all fields with a default\u003d set to"},{"line_number":802,"context_line":"    those values during instantiation, inherit from this class."},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    The base VersionedObject class is designed in such a way that all"},{"line_number":805,"context_line":"    fields are optional, which makes sense when representing a remote"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_8b9f6e63","line":802,"range":{"start_line":801,"start_character":0,"end_line":802,"end_character":63},"in_reply_to":"3fa7e38b_3c557052","updated":"2020-01-13 10:09:10.000000000","message":"OK","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ef186b994f371caf2941b9f5e574e03967d573f3","unresolved":false,"context_lines":[{"line_number":798,"context_line":"class EphemeralObject(object):"},{"line_number":799,"context_line":"    \"\"\"Mix-in to provide more recognizeable field defaulting."},{"line_number":800,"context_line":""},{"line_number":801,"context_line":"    If an object should have all fields with a default\u003d set to"},{"line_number":802,"context_line":"    those values during instantiation, inherit from this class."},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    The base VersionedObject class is designed in such a way that all"},{"line_number":805,"context_line":"    fields are optional, which makes sense when representing a remote"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_3c557052","line":802,"range":{"start_line":801,"start_character":0,"end_line":802,"end_character":63},"in_reply_to":"3fa7e38b_868c582e","updated":"2020-01-10 16:34:54.000000000","message":"Given how the fields-can-be-unset behavior is baked so deeply into VersionedObject, I think that would be pretty jarring. It would also make it hard to have an object without a field set if you needed it, and would probably result in people making everything nullable\u003dTrue,default\u003dNone which is worse, IMHO.","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0dc2ca4ae09da6c9006ae36a1e10c740e1245f45","unresolved":false,"context_lines":[{"line_number":802,"context_line":"    those values during instantiation, inherit from this class."},{"line_number":803,"context_line":""},{"line_number":804,"context_line":"    The base VersionedObject class is designed in such a way that all"},{"line_number":805,"context_line":"    fields are optional, which makes sense when representing a remote"},{"line_number":806,"context_line":"    database row where not all columns are transported across RPC and"},{"line_number":807,"context_line":"    not all columns should be set during an update operation. This is"},{"line_number":808,"context_line":"    why fields with default\u003d are not set implicitly during object"},{"line_number":809,"context_line":"    instantiation, to avoid clobbering existing fields in the"},{"line_number":810,"context_line":"    database. However, objects based on VersionedObject are also used"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_4621804e","line":807,"range":{"start_line":805,"start_character":25,"end_line":807,"end_character":61},"updated":"2020-01-10 11:30:50.000000000","message":"+ \n23:10 \u003c dansmith\u003e all our objects used to be basically 1:1 mappings for the db, but over time we\u0027ve grown a lot more of these general purpose ones, so it used to be easy to say \"you can never ever do this\"\n\n\nI did not fully aware the original design intention behind ovo. So thanks for clarifying it.","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0dc2ca4ae09da6c9006ae36a1e10c740e1245f45","unresolved":false,"context_lines":[{"line_number":804,"context_line":"    The base VersionedObject class is designed in such a way that all"},{"line_number":805,"context_line":"    fields are optional, which makes sense when representing a remote"},{"line_number":806,"context_line":"    database row where not all columns are transported across RPC and"},{"line_number":807,"context_line":"    not all columns should be set during an update operation. This is"},{"line_number":808,"context_line":"    why fields with default\u003d are not set implicitly during object"},{"line_number":809,"context_line":"    instantiation, to avoid clobbering existing fields in the"},{"line_number":810,"context_line":"    database. However, objects based on VersionedObject are also used"},{"line_number":811,"context_line":"    to represent all-or-nothing blobs stored in the database, or even"},{"line_number":812,"context_line":"    used purely in RPC to represent things that are not ever stored in"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_a6d39436","line":809,"range":{"start_line":807,"start_character":62,"end_line":809,"end_character":17},"updated":"2020-01-10 11:30:50.000000000","message":"As far as I understand an ovo that represents a db row never really want to have defaulted ovo field as such defaulting should happen in the db schema level instead. Is it valid understanding?","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d00942319c6faa75378c2b343862faeb6ddc37c5","unresolved":false,"context_lines":[{"line_number":804,"context_line":"    The base VersionedObject class is designed in such a way that all"},{"line_number":805,"context_line":"    fields are optional, which makes sense when representing a remote"},{"line_number":806,"context_line":"    database row where not all columns are transported across RPC and"},{"line_number":807,"context_line":"    not all columns should be set during an update operation. This is"},{"line_number":808,"context_line":"    why fields with default\u003d are not set implicitly during object"},{"line_number":809,"context_line":"    instantiation, to avoid clobbering existing fields in the"},{"line_number":810,"context_line":"    database. However, objects based on VersionedObject are also used"},{"line_number":811,"context_line":"    to represent all-or-nothing blobs stored in the database, or even"},{"line_number":812,"context_line":"    used purely in RPC to represent things that are not ever stored in"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_2baf5a9e","line":809,"range":{"start_line":807,"start_character":62,"end_line":809,"end_character":17},"in_reply_to":"3fa7e38b_5ccdcc2c","updated":"2020-01-13 10:09:10.000000000","message":"ah, thanks for the defining the set semantic.","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ef186b994f371caf2941b9f5e574e03967d573f3","unresolved":false,"context_lines":[{"line_number":804,"context_line":"    The base VersionedObject class is designed in such a way that all"},{"line_number":805,"context_line":"    fields are optional, which makes sense when representing a remote"},{"line_number":806,"context_line":"    database row where not all columns are transported across RPC and"},{"line_number":807,"context_line":"    not all columns should be set during an update operation. This is"},{"line_number":808,"context_line":"    why fields with default\u003d are not set implicitly during object"},{"line_number":809,"context_line":"    instantiation, to avoid clobbering existing fields in the"},{"line_number":810,"context_line":"    database. However, objects based on VersionedObject are also used"},{"line_number":811,"context_line":"    to represent all-or-nothing blobs stored in the database, or even"},{"line_number":812,"context_line":"    used purely in RPC to represent things that are not ever stored in"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_5ccdcc2c","line":809,"range":{"start_line":807,"start_character":62,"end_line":809,"end_character":17},"in_reply_to":"3fa7e38b_a6d39436","updated":"2020-01-10 16:34:54.000000000","message":"For create, yes. For update, there\u0027s no defaulting because having a field unset in the object means \"leave this column set to whatever it currently is.\"","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0dc2ca4ae09da6c9006ae36a1e10c740e1245f45","unresolved":false,"context_lines":[{"line_number":808,"context_line":"    why fields with default\u003d are not set implicitly during object"},{"line_number":809,"context_line":"    instantiation, to avoid clobbering existing fields in the"},{"line_number":810,"context_line":"    database. However, objects based on VersionedObject are also used"},{"line_number":811,"context_line":"    to represent all-or-nothing blobs stored in the database, or even"},{"line_number":812,"context_line":"    used purely in RPC to represent things that are not ever stored in"},{"line_number":813,"context_line":"    the database. Thus, this mix-in is provided for these latter"},{"line_number":814,"context_line":"    object use cases where the desired behavior is to always have"},{"line_number":815,"context_line":"    default\u003d fields be set at __init__ time."},{"line_number":816,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_26dfa438","line":813,"range":{"start_line":811,"start_character":65,"end_line":813,"end_character":17},"updated":"2020-01-10 11:30:50.000000000","message":"yeah this is the use case where I would need defaulting during __init__","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0dc2ca4ae09da6c9006ae36a1e10c740e1245f45","unresolved":false,"context_lines":[{"line_number":815,"context_line":"    default\u003d fields be set at __init__ time."},{"line_number":816,"context_line":"    \"\"\""},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":819,"context_line":"        super(EphemeralObject, self).__init__(*args, **kwargs)"},{"line_number":820,"context_line":"        # Not specifying any fields causes all defaulted fields to be set"},{"line_number":821,"context_line":"        self.obj_set_defaults()"},{"line_number":822,"context_line":""},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"class ObjectListBase(collections_abc.Sequence):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_c697b045","line":821,"range":{"start_line":818,"start_character":0,"end_line":821,"end_character":31},"updated":"2020-01-10 11:30:50.000000000","message":"+2, I want this.\n\nAlternatively I would be OK to have the defaulting happen at lazy load time if it is also done automatically. But the current proposal is the less complex, more understandable one.","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ef186b994f371caf2941b9f5e574e03967d573f3","unresolved":false,"context_lines":[{"line_number":815,"context_line":"    default\u003d fields be set at __init__ time."},{"line_number":816,"context_line":"    \"\"\""},{"line_number":817,"context_line":""},{"line_number":818,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":819,"context_line":"        super(EphemeralObject, self).__init__(*args, **kwargs)"},{"line_number":820,"context_line":"        # Not specifying any fields causes all defaulted fields to be set"},{"line_number":821,"context_line":"        self.obj_set_defaults()"},{"line_number":822,"context_line":""},{"line_number":823,"context_line":""},{"line_number":824,"context_line":"class ObjectListBase(collections_abc.Sequence):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_1cfc343d","line":821,"range":{"start_line":818,"start_character":0,"end_line":821,"end_character":31},"in_reply_to":"3fa7e38b_c697b045","updated":"2020-01-10 16:34:54.000000000","message":"Yeah, there\u0027s no real reason to do it at lazy-load time if we have this categorical classification of objects that behave this way.","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"}],"oslo_versionedobjects/tests/test_objects.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"0dc2ca4ae09da6c9006ae36a1e10c740e1245f45","unresolved":false,"context_lines":[{"line_number":2501,"context_line":"    def test_defaults_are_set(self):"},{"line_number":2502,"context_line":"        obj \u003d self.myclass()"},{"line_number":2503,"context_line":"        self.assertIn(\u0027field1\u0027, obj)"},{"line_number":2504,"context_line":"        self.assertNotIn(\u0027field2\u0027, obj)"},{"line_number":2505,"context_line":"        self.assertEqual(\u0027foobar\u0027, obj.field1)"},{"line_number":2506,"context_line":""},{"line_number":2507,"context_line":"    def test_defaults_do_not_override_args(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_66aefc80","line":2504,"updated":"2020-01-10 11:30:50.000000000","message":"I\u0027m OK with this behavior (see my comment in EphemeralObject) about it.","commit_id":"f0de5ab0a29d08a35040d5f6c3f449f9b31110ec"}]}
