Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit 6306478

Browse files
authored
chore: fix udf text dedent format (#2468)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent 0f1ac1a commit 6306478

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

bigframes/functions/function_template.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,10 @@ def generate_managed_function_code(
331331
udf_code = textwrap.dedent(inspect.getsource(get_pd_series))
332332
udf_code = udf_code[udf_code.index("def") :]
333333
bigframes_handler_code = textwrap.dedent(
334-
f"""def bigframes_handler(str_arg):
335-
return {udf_name}({get_pd_series.__name__}(str_arg))"""
334+
f"""
335+
def bigframes_handler(str_arg):
336+
return {udf_name}({get_pd_series.__name__}(str_arg))
337+
"""
336338
)
337339

338340
sig = inspect.signature(def_)
@@ -352,15 +354,19 @@ def generate_managed_function_code(
352354
udf_call_str = ", ".join(udf_call_parts)
353355

354356
bigframes_handler_code = textwrap.dedent(
355-
f"""def bigframes_handler({handler_def_str}):
356-
return {udf_name}({udf_call_str})"""
357+
f"""
358+
def bigframes_handler({handler_def_str}):
359+
return {udf_name}({udf_call_str})
360+
"""
357361
)
358362

359363
else:
360364
udf_code = ""
361365
bigframes_handler_code = textwrap.dedent(
362-
f"""def bigframes_handler(*args):
363-
return {udf_name}(*args)"""
366+
f"""
367+
def bigframes_handler(*args):
368+
return {udf_name}(*args)
369+
"""
364370
)
365371

366372
udf_code_block = []

0 commit comments

Comments
 (0)