github-actions[bot] commented on code in PR #41127:
URL: https://github.com/apache/beam/pull/41127#discussion_r4515597532


##########
sdks/python/apache_beam/utils/windowed_value.pxd:
##########
@@ -58,6 +60,6 @@ cpdef WindowedValue create(
 
 cdef class _IntervalWindowBase(object):
   cdef object _start_object
-  cdef readonly int64_t _start_micros
+  cdef public int64_t _start_micros

Review Comment:
   **🟢 Low**: `cdef readonly` already generates the Python attribute getter 
needed for untyped reads (such as `other._start_micros` in `__eq__`) while 
still permitting direct C-level writes within `_IntervalWindowBase` and Cython 
callers with a typed `_IntervalWindowBase` reference (such as 
`IntervalWindowCoderImpl.decode_from_stream`). Making `_start_micros` (and 
`_end_micros` on line 65) `public` allows Python code to mutate the microsecond 
bounds of a hashable window after `_start_object` / `_end_object` have been 
lazily cached. Unless external Python mutation is required, prefer keeping 
these `readonly`.
   
   ```suggestion
     cdef readonly int64_t _start_micros
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to