texera icon indicating copy to clipboard operation
texera copied to clipboard

Python UDF Source V2 edit would cause JSON parse error

Open Yicong-Huang opened this issue 3 years ago • 5 comments

  1. formly produces a [{}] when editing schema list of Python UDF Source V2 from empty schema.
  2. CacheStatusUpdateRequest is sent because the workflow is changed (schema changed to [{}]). even when the operator is not enabled with cache.
  3. Upon handling the above request, Jackson parses [{}] with List[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:

  1. Make formly do not generate [{}] when editing Attributes.
  2. Make CacheStatusUpdateRequest not to be sent when editing a non-enabled-cache operator.

Yicong-Huang avatar Oct 27 '21 19:10 Yicong-Huang

group discussion 1/13: we can assign this to an undergrad. Low priority.

zuozhiw avatar Jan 13 '22 22:01 zuozhiw

Discussion 2022.05.12: @zuozhiw will work on this.

Xiao-zhen-Liu avatar May 12 '22 20:05 Xiao-zhen-Liu

Discussion 2022.12.07: @zuozhiw and @Yicong-Huang will talk offline about this.

Xiao-zhen-Liu avatar Dec 08 '22 00:12 Xiao-zhen-Liu

Update Apr. 17 2023: Could be solved by #1843.

Xiao-zhen-Liu avatar Apr 17 '23 20:04 Xiao-zhen-Liu

Will be solved after we bump the formly version.

shengquan-ni avatar Dec 19 '23 18:12 shengquan-ni