[ 
https://issues.apache.org/jira/browse/BEAM-14430?focusedWorklogId=769922&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-769922
 ]

ASF GitHub Bot logged work on BEAM-14430:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 12/May/22 21:54
            Start Date: 12/May/22 21:54
    Worklog Time Spent: 10m 
      Work Description: ihji commented on code in PR #17608:
URL: https://github.com/apache/beam/pull/17608#discussion_r871838609


##########
sdks/java/core/src/main/java/org/apache/beam/sdk/schemas/logicaltypes/PythonCallable.java:
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.sdk.schemas.logicaltypes;
+
+import org.apache.beam.sdk.annotations.Experimental;
+import org.apache.beam.sdk.schemas.Schema;
+import org.apache.beam.sdk.schemas.Schema.LogicalType;
+import org.apache.beam.sdk.util.PythonCallableSource;
+import org.checkerframework.checker.nullness.qual.NonNull;
+import org.checkerframework.checker.nullness.qual.Nullable;
+
+/** A logical type for PythonCallableSource objects. */
+@Experimental(Experimental.Kind.SCHEMAS)
+public class PythonCallable implements LogicalType<PythonCallableSource, 
String> {
+  public static final String IDENTIFIER = 
"beam:logical_type:python_callable:v1";

Review Comment:
   Added to schema protos.



##########
sdks/java/extensions/python/src/test/java/org/apache/beam/sdk/extensions/python/PythonExternalTransformTest.java:
##########
@@ -184,6 +186,19 @@ public void generateArgsWithCustomType() {
     assertEquals(456, (int) receivedRow.getRow("field1").getInt32("intField"));
   }
 
+  @Test
+  public void generateArgsWithTypeHint() {
+    PythonExternalTransform<?, ?> transform =
+        PythonExternalTransform
+            .<PCollection<KV<String, String>>, PCollection<KV<String, 
Iterable<String>>>>from(
+                "DummyTransform")
+            .withArgs(PythonCallableSource.of("dummy data"))
+            .withTypeHint(

Review Comment:
   Done.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 769922)
    Time Spent: 2h 40m  (was: 2.5h)

> Adding a logical type support for Python callables to Row schema
> ----------------------------------------------------------------
>
>                 Key: BEAM-14430
>                 URL: https://issues.apache.org/jira/browse/BEAM-14430
>             Project: Beam
>          Issue Type: New Feature
>          Components: cross-language
>            Reporter: Heejong Lee
>            Assignee: Heejong Lee
>            Priority: P2
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Adding a logical type support for Python callables to Row schema



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to