@@ -77,6 +77,10 @@ private PythonExternalTransform(String fullyQualifiedName, String expansionServi
|
77 | 77 | this.expansionService = expansionService; |
78 | 78 | this.kwargsMap = new TreeMap<>(); |
79 | 79 | this.typeHints = new HashMap<>(); |
| 80 | +// TODO(BEAM-14458): remove a default type hint for PythonCallableSource when BEAM-14458 is |
| 81 | +// resolved |
| 82 | +this.typeHints.put( |
| 83 | +PythonCallableSource.class, Schema.FieldType.logicalType(new PythonCallable())); |
80 | 84 | argsArray = new Object[] {}; |
81 | 85 | } |
82 | 86 | |
@@ -204,14 +208,12 @@ Row buildOrGetKwargsRow() {
|
204 | 208 | // Types that are not one of following are considered custom types. |
205 | 209 | // * Java primitives |
206 | 210 | // * Type String |
207 | | -// * Type PythonCallableSource |
208 | 211 | // * Any Type explicitly annotated by withTypeHint() |
209 | 212 | // * Type Row |
210 | 213 | private boolean isCustomType(java.lang.Class<?> type) { |
211 | 214 | boolean val = |
212 | 215 | !(ClassUtils.isPrimitiveOrWrapper(type) |
213 | 216 | || type == String.class |
214 | | - || type == PythonCallableSource.class |
215 | 217 | || typeHints.containsKey(type) |
216 | 218 | || Row.class.isAssignableFrom(type)); |
217 | 219 | return val; |
@@ -268,8 +270,6 @@ private Schema generateSchemaDirectly(
|
268 | 270 | if (field instanceof Row) { |
269 | 271 | // Rows are used as is but other types are converted to proper field types. |
270 | 272 | builder.addRowField(fieldName, ((Row) field).getSchema()); |
271 | | - } else if (field instanceof PythonCallableSource) { |
272 | | -builder.addField(fieldName, Schema.FieldType.logicalType(new PythonCallable())); |
273 | 273 | } else if (typeHints.containsKey(field.getClass())) { |
274 | 274 | builder.addField(fieldName, typeHints.get(field.getClass())); |
275 | 275 | } else { |
|