skrawcz commented on code in PR #656:
URL: https://github.com/apache/burr/pull/656#discussion_r2836505839


##########
burr/core/action.py:
##########
@@ -49,6 +49,56 @@
     from typing import Self
 
 from burr.core.state import State
+
+def _validate_declared_reads(fn: Callable, declared_reads: list[str]) -> None:
+    try:
+        source = inspect.getsource(fn)
+    except OSError:
+        return  # skip if source unavailable
+    
+    # detect actual state parameter name
+    sig = inspect.signature(fn)
+    state_param_name = None
+
+    for name, param in sig.parameters.items():
+        if param.annotation is State:
+            state_param_name = name
+            break
+
+    if state_param_name is None:
+        return
+
+
+    import textwrap

Review Comment:
   imports should be top level
   



-- 
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