texera
texera copied to clipboard
Python UDF Source V2 edit would cause JSON parse error
- formly produces a
[{}]
when editing schema list of Python UDF Source V2 from empty schema. -
CacheStatusUpdateRequest
is sent because the workflow is changed (schema changed to[{}]
). even when the operator is not enabled with cache. - Upon handling the above request, Jackson parses
[{}]
withList[Attribute]
would cause error.
Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Missing required creator property 'attributeName' (index 0)
at [Source: (String)"{"type":"CacheStatusUpdateRequest","operators":[{"code":"from typing import Iterator, Optional, Union\nfrom pytexera import InputExhausted, Tuple, TupleLike, UDFOperator, overrides\n\nclass SourceOperator(UDFOperator):\n \n @overrides\n def process_tuple(self, tuple_: Union[Tuple, InputExhausted], input_: int) -> Iterator[Optional[TupleLike]]:\n if isinstance(tuple_, InputExhausted):\n yield {\"text\": \"hello world\"}","columns":[{}],"parallel":false,"operatorID":"Pyt"[truncated 897 chars]; line: 1, column: 578] (through reference chain: edu.uci.ics.texera.web.model.websocket.request.CacheStatusUpdateRequest["operators"]->com.fasterxml.jackson.module.scala.deser.GenericFactoryDeserializerResolver$BuilderWrapper[0]->edu.uci.ics.texera.workflow.operators.udf.pythonV2.source.PythonUDFSourceOpDescV2["columns"]->java.util.ArrayList[0]->edu.uci.ics.texera.workflow.common.tuple.schema.Attribute["attributeName"])
Possible Solution:
- Make formly do not generate
[{}]
when editing Attributes. - Make
CacheStatusUpdateRequest
not to be sent when editing a non-enabled-cache operator.
group discussion 1/13: we can assign this to an undergrad. Low priority.
Discussion 2022.05.12: @zuozhiw will work on this.
Discussion 2022.12.07: @zuozhiw and @Yicong-Huang will talk offline about this.
Update Apr. 17 2023: Could be solved by #1843.
Will be solved after we bump the formly version.