From 5df2a57fc524f9db00ee1d31da903937dca0750a Mon Sep 17 00:00:00 2001 From: DKPHUONG Date: Sun, 29 Sep 2024 20:10:49 +0700 Subject: [PATCH] add strip --- sdks/python/apache_beam/transforms/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/transforms/core.py b/sdks/python/apache_beam/transforms/core.py index a3762adac0cb..3fec653a705b 100644 --- a/sdks/python/apache_beam/transforms/core.py +++ b/sdks/python/apache_beam/transforms/core.py @@ -1461,7 +1461,7 @@ def partition_for(self, element, num_partitions, *args, **kwargs): def _get_function_body_without_inners(func): source_lines = inspect.getsourcelines(func)[0] - source_lines = dropwhile(lambda x: x.startswith("@"), source_lines) + source_lines = dropwhile(lambda x: x.strip().startswith("@"), source_lines) first_def_line = next(source_lines).strip() if first_def_line.startswith("def "): last_def_line_without_comment = first_def_line.split("#")[0] \