)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":34930,"name":"Jianjian Huo","email":"jhuo@nvidia.com","username":"jhuo"},"change_message_id":"e6756821b06e384e60cbeb493b2bb257877315b7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d5da6ed1_7fd80742","updated":"2026-04-16 22:50:37.000000000","message":"``-1`` because the commit message (to tolerate float) conflicts with the class docstring (needs to be int).","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"425b1d1614aa9fb97fc61a5fa38e2893aa093e35","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"be73d29d_f726baf6","updated":"2026-04-22 16:53:23.000000000","message":"One thought -- could probably be a follow-up, though.","commit_id":"7047457e5853c4a8112cbb9b15b4ab4b90f2edf6"}],"swift/common/utils/timestamp.py":[{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"d7200fbd6cfb8505e184a9662d35e9fd2e90d931","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self.raw \u003d int(round(float_timestamp / PRECISION))"},{"line_number":113,"context_line":"        # add delta"},{"line_number":114,"context_line":"        if delta:"},{"line_number":115,"context_line":"            self.raw \u003d self.raw + int(round(delta))"},{"line_number":116,"context_line":"            if self.raw \u003c\u003d 0:"},{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"}],"source_content_type":"text/x-python","patch_set":1,"id":"f2edb628_961c5760","line":115,"updated":"2026-04-16 04:55:22.000000000","message":"Yeah if the ndigits param is left out then it\u0027ll return as an int, otherwise it\u0027ll still be an float. so round should be enough, but don\u0027t mind the int, because it does make it more obvious.\n\nIs round what we want here tho, were talking about the number of deca-microseconds. So already very small. I might just have PTSD from trying to get everything into into nanosecond range and rounding issues were a PITA in tests.\nAnother option is to use floor and ignore anything after the the period (which I think is what int() would do to an int anyway).\n\nBut I don\u0027t really have strong feelings on floor, so this is fine.","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"2ab17c23e7de0c283d1a5f725804ae8e0feeac3e","unresolved":true,"context_lines":[{"line_number":112,"context_line":"        self.raw \u003d int(round(float_timestamp / PRECISION))"},{"line_number":113,"context_line":"        # add delta"},{"line_number":114,"context_line":"        if delta:"},{"line_number":115,"context_line":"            self.raw \u003d self.raw + int(round(delta))"},{"line_number":116,"context_line":"            if self.raw \u003c\u003d 0:"},{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"}],"source_content_type":"text/x-python","patch_set":1,"id":"21922bce_ce40744b","line":115,"updated":"2026-04-15 12:01:08.000000000","message":"the ``int()`` is not necessary but being explicit avoids having to going to check the doc for ``round``","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":34930,"name":"Jianjian Huo","email":"jhuo@nvidia.com","username":"jhuo"},"change_message_id":"e6756821b06e384e60cbeb493b2bb257877315b7","unresolved":true,"context_lines":[{"line_number":112,"context_line":"        self.raw \u003d int(round(float_timestamp / PRECISION))"},{"line_number":113,"context_line":"        # add delta"},{"line_number":114,"context_line":"        if delta:"},{"line_number":115,"context_line":"            self.raw \u003d self.raw + int(round(delta))"},{"line_number":116,"context_line":"            if self.raw \u003c\u003d 0:"},{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"}],"source_content_type":"text/x-python","patch_set":1,"id":"c2e5ff27_df56dfbb","line":115,"in_reply_to":"21922bce_ce40744b","updated":"2026-04-16 22:50:37.000000000","message":"according to the docstring, ``delta`` should be an int, xxx deca-microseconds.\n```\n:param delta: deca-microsecond difference from the base timestamp\n                      param, an int\n```\n\nhowever, this patch intends to tolerate a float number input\n\u003e This patch rounds delta to the nearest int i.e. a float is tolerated\nbut rounded to preserve deca-microsecond precision in\nTimestamp.raw.\n\nSo we have to fix docstring if it\u0027s okay for ``delta`` to be a float.\n\nThe intention of the change is to prevent a float number  ``delta`` to coerce ``BaseTimestamp.raw`` to be a float, since there is no caller who would pass a float yet (unless a caller issue), I wonder what if we just enforce the rule which the docstring already declares, like:\n```\nif not isinstance(delta, int): raise TypeError(...)\n```","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6b45ab5795d9f9dc656c456f47097141dc7ae493","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self.raw \u003d int(round(float_timestamp / PRECISION))"},{"line_number":113,"context_line":"        # add delta"},{"line_number":114,"context_line":"        if delta:"},{"line_number":115,"context_line":"            self.raw \u003d self.raw + int(round(delta))"},{"line_number":116,"context_line":"            if self.raw \u003c\u003d 0:"},{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3bcfeb46_3a48435b","line":115,"in_reply_to":"68553bd9_a750a0a0","updated":"2026-04-22 09:33:00.000000000","message":"Done","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e13fa41ca454208d2ce0a9cc8904c2e8f55919cb","unresolved":true,"context_lines":[{"line_number":112,"context_line":"        self.raw \u003d int(round(float_timestamp / PRECISION))"},{"line_number":113,"context_line":"        # add delta"},{"line_number":114,"context_line":"        if delta:"},{"line_number":115,"context_line":"            self.raw \u003d self.raw + int(round(delta))"},{"line_number":116,"context_line":"            if self.raw \u003c\u003d 0:"},{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"}],"source_content_type":"text/x-python","patch_set":1,"id":"68553bd9_a750a0a0","line":115,"in_reply_to":"c2e5ff27_df56dfbb","updated":"2026-04-17 15:59:57.000000000","message":"I\u0027m opposed to\n \n``if not isinstance(delta, int): raise TypeError(...)``\n\nbecause that breaks ``Timestamp(123, delta\u003d1.0)`` which is actually perfectly acceptable.\n\nI\u0027m reluctant to write\n\n``if int(delta) !\u003d delta: raise ValueError(...)``\n\nbecause that breaks ``Timestamp(123, delta\u003d1.1)`` which currently works, so why break it?\n\nSo I am inclined to fix the doc string.","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e13fa41ca454208d2ce0a9cc8904c2e8f55919cb","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self.raw \u003d int(round(float_timestamp / PRECISION))"},{"line_number":113,"context_line":"        # add delta"},{"line_number":114,"context_line":"        if delta:"},{"line_number":115,"context_line":"            self.raw \u003d self.raw + int(round(delta))"},{"line_number":116,"context_line":"            if self.raw \u003c\u003d 0:"},{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"}],"source_content_type":"text/x-python","patch_set":1,"id":"926911aa_cfe46876","line":115,"in_reply_to":"f2edb628_961c5760","updated":"2026-04-17 15:59:57.000000000","message":"I went with round to match what happens to the float timestamp, but I don\u0027t really mind if we drop the round and just floor (which is what ``int(delta)`` would do). The goal is to prevent a caller messing with the expected type of ``raw`` by sneaking in a float delta.","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"e13fa41ca454208d2ce0a9cc8904c2e8f55919cb","unresolved":true,"context_lines":[{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.timestamp \u003d round(float(self.raw * PRECISION), 5)"},{"line_number":121,"context_line":"        if check_bounds:"},{"line_number":122,"context_line":"            if self.timestamp \u003c 0:"},{"line_number":123,"context_line":"                raise ValueError(\u0027timestamp cannot be negative\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ec14b194_e684df60","line":120,"range":{"start_line":120,"start_character":31,"end_line":120,"end_character":58},"updated":"2026-04-17 15:59:57.000000000","message":"I noticed that my change would modify the timestamp value that you\u0027d get with some floating point deltas when compared to master, because we are at the limit of float digits, so rounding behaviour is harder to predict.\n\nI don\u0027t want to change the outcome of calling Timestamp(\u003cfloat\u003e, delta\u003d\u003cfloat\u003e) w.r.t. to master, so I am abandoning this approach.\n\nInstead, I propose to make \u0027raw\u0027 a *property* that is always the int number of deca-microseconds. It\u0027s crazy that raw and timestamp are both public, modifiable attributes. One should be dependent on the other. If I make \u0027raw\u0027 a property based on \u0027timestamp\u0027 then we no longer need to care about the impact delta being a float.","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6b45ab5795d9f9dc656c456f47097141dc7ae493","unresolved":false,"context_lines":[{"line_number":117,"context_line":"                raise ValueError("},{"line_number":118,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * self.raw))"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"        self.timestamp \u003d round(float(self.raw * PRECISION), 5)"},{"line_number":121,"context_line":"        if check_bounds:"},{"line_number":122,"context_line":"            if self.timestamp \u003c 0:"},{"line_number":123,"context_line":"                raise ValueError(\u0027timestamp cannot be negative\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"e9debd3c_de84354e","line":120,"range":{"start_line":120,"start_character":31,"end_line":120,"end_character":58},"in_reply_to":"ec14b194_e684df60","updated":"2026-04-22 09:33:00.000000000","message":"Done","commit_id":"b9376ef301f6c905f05f122853b3ce0ec184d5d3"},{"author":{"_account_id":15343,"name":"Tim Burke","email":"tburke@nvidia.com","username":"tburke"},"change_message_id":"425b1d1614aa9fb97fc61a5fa38e2893aa093e35","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                raise ValueError("},{"line_number":100,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * raw))"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self.timestamp \u003d round(float(raw * PRECISION), 5)"},{"line_number":103,"context_line":"        if check_bounds:"},{"line_number":104,"context_line":"            self._check_bounds()"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"cad06a71_1f12d15d","line":102,"updated":"2026-04-22 16:53:23.000000000","message":"Maybe it\u0027s just my general distrust of floats, but... I wonder if `raw` should be the source of truth, and `timestamp` the property.","commit_id":"7047457e5853c4a8112cbb9b15b4ab4b90f2edf6"},{"author":{"_account_id":7847,"name":"Alistair Coles","email":"alistairncoles@gmail.com","username":"acoles"},"change_message_id":"6583d3e6633b20a62bf7bcb672cc52559742c776","unresolved":true,"context_lines":[{"line_number":99,"context_line":"                raise ValueError("},{"line_number":100,"context_line":"                    \u0027delta must be greater than %d\u0027 % (-1 * raw))"},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        self.timestamp \u003d round(float(raw * PRECISION), 5)"},{"line_number":103,"context_line":"        if check_bounds:"},{"line_number":104,"context_line":"            self._check_bounds()"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"16e83814_aab42f70","line":102,"in_reply_to":"cad06a71_1f12d15d","updated":"2026-04-24 13:55:08.000000000","message":"I could buy into that. TBH though I got worried about how to handle callers passing in float delta (like delta\u003d1.1) and wanting raw to always be an int, but also not change the float value for any existing call. If raw is the source of truth then I wasn\u0027t sure how best to round it to an int without risking changing the result of Timestamp(float, delta\u003d\u003cfloat\u003e) for some value of delta. (Thinking about some out of tree caller :/ ).\n\nI dodged that by preserving the float timestamp and just rounding in the ``raw`` accessor","commit_id":"7047457e5853c4a8112cbb9b15b4ab4b90f2edf6"}]}
