You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "riteshghorse (via GitHub)" <gi...@apache.org> on 2023/04/14 15:43:56 UTC

[GitHub] [beam] riteshghorse commented on a diff in pull request #26220: [Python] Allow users to pass service name for profiler

riteshghorse commented on code in PR #26220:
URL: https://github.com/apache/beam/pull/26220#discussion_r1166996541


##########
sdks/python/apache_beam/runners/worker/sdk_worker_main.py:
##########
@@ -175,20 +175,32 @@ def create_harness(environment, dry_run=False):
 
 def main(unused_argv):
   """Main entry point for SDK Fn Harness."""
-  fn_log_handler, sdk_harness, sdk_pipeline_options = create_harness(os.environ)
-  experiments = sdk_pipeline_options.view_as(DebugOptions).experiments or []
+  (fn_log_handler, sdk_harness,
+   sdk_pipeline_options) = create_harness(os.environ)
   dataflow_service_options = (
       sdk_pipeline_options.view_as(GoogleCloudOptions).dataflow_service_options
       or [])
-  if (_ENABLE_GOOGLE_CLOUD_PROFILER in experiments) or (
-      _ENABLE_GOOGLE_CLOUD_PROFILER in dataflow_service_options):
+  experiments = (sdk_pipeline_options.view_as(DebugOptions).experiments or [])

Review Comment:
   fixed



##########
sdks/python/apache_beam/runners/worker/sdk_worker_main.py:
##########
@@ -175,20 +175,32 @@ def create_harness(environment, dry_run=False):
 
 def main(unused_argv):
   """Main entry point for SDK Fn Harness."""
-  fn_log_handler, sdk_harness, sdk_pipeline_options = create_harness(os.environ)
-  experiments = sdk_pipeline_options.view_as(DebugOptions).experiments or []
+  (fn_log_handler, sdk_harness,
+   sdk_pipeline_options) = create_harness(os.environ)
   dataflow_service_options = (
       sdk_pipeline_options.view_as(GoogleCloudOptions).dataflow_service_options
       or [])
-  if (_ENABLE_GOOGLE_CLOUD_PROFILER in experiments) or (
-      _ENABLE_GOOGLE_CLOUD_PROFILER in dataflow_service_options):
+  experiments = (sdk_pipeline_options.view_as(DebugOptions).experiments or [])
+  exp = None
+  if ((_ENABLE_GOOGLE_CLOUD_PROFILER in experiments) or
+      (_ENABLE_GOOGLE_CLOUD_PROFILER in dataflow_service_options)):
+    exp = True
+  for experiment in experiments:
+    if experiment.startswith(_ENABLE_GOOGLE_CLOUD_PROFILER + '='):
+      exp = experiment.split('=', 1)[1]

Review Comment:
   done



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org