You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@texera.apache.org by gi...@apache.org on 2026/08/07 05:43:23 UTC

(texera) branch gh-readonly-queue/main/pr-7375-23ea0fadf85578a45c82c828fb2ce5b9e48bd494 created (now 5fe5fde95b)

This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a change to branch gh-readonly-queue/main/pr-7375-23ea0fadf85578a45c82c828fb2ce5b9e48bd494
in repository https://gitbox.apache.org/repos/asf/texera.git


      at 5fe5fde95b chore(amber): correct three invalid R tuple UDF examples (#7375)

This branch includes the following new commits:

     new 5fe5fde95b chore(amber): correct three invalid R tuple UDF examples (#7375)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(texera) 01/01: chore(amber): correct three invalid R tuple UDF examples (#7375)

Posted by gi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

github-merge-queue[bot] pushed a commit to branch gh-readonly-queue/main/pr-7375-23ea0fadf85578a45c82c828fb2ce5b9e48bd494
in repository https://gitbox.apache.org/repos/asf/texera.git

commit 5fe5fde95b5d97fbbaf09b3efd605bcdb80dd67f
Author: Eugene Gu <eu...@outlook.com>
AuthorDate: Thu Aug 6 22:43:01 2026 -0700

    chore(amber): correct three invalid R tuple UDF examples (#7375)
    
    ### What changes were proposed in this PR?
    
    Three of the six R example templates in
    `amber/src/main/python/pytexera/udf/examples/rudf/r_tuple_operator.py`
    were invalid R:
    
    - `r_tuple_source_multiple_tuples` and
    `r_tuple_udf_echo_multiple_tuples` were missing a closing `}` — the
    final `})` only closed the `for` block, so R fails to parse them
    (`unexpected ')'`).
    - `r_tuple_source_one_tuple` and `r_tuple_source_multiple_tuples` had a
    trailing comma in their `list(...)` call, which fails at eval time
    (`argument 4 is empty`).
    
    This PR adds the missing braces, removes the trailing commas, and makes
    the multiple-tuples source yield `attr1 = i` so the five rows differ.
    
    These templates are reference examples only — nothing in the repo
    imports them, and the operators' actual default code is unaffected.
    
    ### Any related issues, documentation, discussions?
    
    Closes #7372
    
    ### How was this PR tested?
    
    Ran every template in both rudf example files through `Rscript parse()`
    — all pass after the fix (the two broken ones failed before) — and
    eval-checked the fixed `list(...)` call. `ruff check` and `ruff format
    --check` pass. No test is added because CI has no R and nothing imports
    this file.
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    Co-authored by: Claude Code
---
 .../pytexera/udf/examples/rudf/r_tuple_operator.py | 24 ++++++++++++----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/amber/src/main/python/pytexera/udf/examples/rudf/r_tuple_operator.py b/amber/src/main/python/pytexera/udf/examples/rudf/r_tuple_operator.py
index 4aeb8a010c..e8a6cfa3ad 100644
--- a/amber/src/main/python/pytexera/udf/examples/rudf/r_tuple_operator.py
+++ b/amber/src/main/python/pytexera/udf/examples/rudf/r_tuple_operator.py
@@ -30,11 +30,11 @@ r_tuple_source_one_tuple = """
 library(coro)
 coro::generator(function() {
     yield (list(
-            attr1 = 1L, # R integer
-            attr2 = "A", # R string
-            attr3 = TRUE, # R logical (boolean)
-            ))
-    })
+        attr1 = 1L,   # R integer
+        attr2 = "A",  # R string
+        attr3 = TRUE  # R logical (boolean)
+    ))
+})
 """
 
 r_tuple_source_multiple_tuples = """
@@ -42,11 +42,12 @@ library(coro)
 coro::generator(function() {
     for (i in 1:5) {
         yield (list(
-            attr1 = 1L, # R integer
-            attr2 = "A", # R string
-            attr3 = TRUE, # R logical (boolean)
-            ))
-    })
+            attr1 = i,    # R integer
+            attr2 = "A",  # R string
+            attr3 = TRUE  # R logical (boolean)
+        ))
+    }
+})
 """
 
 # --- UDF Operator ---
@@ -69,5 +70,6 @@ library(coro)
 coro::generator(function(tuple, port) {
     for (i in 1:5) {
         yield (tuple)
-    })
+    }
+})
 """