AnandInguva commented on code in PR #28848:
URL: https://github.com/apache/beam/pull/28848#discussion_r1347930679


##########
sdks/python/apache_beam/transforms/resources.py:
##########
@@ -177,6 +178,20 @@ def get_merged_value(
 ResourceHint.register_resource_hint('minRam', MinRamHint)
 
 
+class CpuCountHint(ResourceHint):
+  """Describes desired hardware accelerators in execution environment."""
+  urn = resource_hints.CPU_COUNT.urn
+
+  @classmethod
+  def get_merged_value(
+      cls, outer_value, inner_value):  # type: (int, int) -> int
+    return ResourceHint._use_max(outer_value, inner_value)
+
+
+ResourceHint.register_resource_hint('cpu_count', CpuCountHint)
+ResourceHint.register_resource_hint('cpuCount', CpuCountHint)

Review Comment:
   add a comment `# Alias for interoperability with SDKs preferring camelCase.` 
on why 2 names for CpuCountHint for readability. 



##########
sdks/python/.python-version:
##########
@@ -0,0 +1 @@
+3.10.7

Review Comment:
   Remove this file.



##########
sdks/python/apache_beam/transforms/resources.py:
##########
@@ -177,6 +178,20 @@ def get_merged_value(
 ResourceHint.register_resource_hint('minRam', MinRamHint)
 
 
+class CpuCountHint(ResourceHint):
+  """Describes desired hardware accelerators in execution environment."""

Review Comment:
   ```suggestion
     """Describes desired number of CPUs available in transform's execution 
environment."""
   ```



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