jrmccluskey commented on code in PR #37218:
URL: https://github.com/apache/beam/pull/37218#discussion_r2673074188


##########
sdks/python/apache_beam/ml/inference/base_test.py:
##########
@@ -2071,6 +2071,70 @@ def run_inference(self,
             responses.append(model.predict(example))
           return responses
 
+  def test_run_inference_with_rate_limiter(self):
+    class FakeRateLimiter(base.RateLimiter):
+      def __init__(self):
+        super().__init__(namespace='test_namespace')
+
+      def throttle(self, hits_added=1):
+        self.requests_counter.inc()
+        return True

Review Comment:
   sorry, I'm still not following this logic based based on the description in 
the RateLimiter class:
   
   
https://github.com/apache/beam/blob/6bedec369f7658a515cd6c39c79d0c753ac79a4d/sdks/python/apache_beam/io/components/rate_limiter.py#L63-L77
   
   "Check if request should be throttled" as a docstring, but then responding 
with a `True` if the request is allowed feels backwards. `throttle()` returning 
`False` sounds like the request isn't being throttled or limited in any way, 
when that isn't the case.  That's where the disconnect is here. 



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