eugenegujing opened a new issue, #7565:
URL: https://github.com/apache/texera/issues/7565

   ### What happened?
   
   When a user sets a non-integer `BATCH_SIZE` on a Python operator, the error 
message they get back contains the template text rather than the actual type, 
because the string is a plain string literal instead of an f-string and it 
additionally has an unbalanced parenthesis inside the placeholder.
   
   The user sees:
   
   ```
   BATCH_SIZE cannot be {type(value))}.
   ```
   
   instead of something like:
   
   ```
   BATCH_SIZE cannot be <class 'float'>.
   ```
   
   **Expected:** the message names the actual type that was supplied.
   
   ### How to reproduce?
   
   1. Add a Python UDF operator to a workflow.
   2. In its code, set a non-integer batch size, e.g.:
      ```python
      from pytexera import *
   
      class ProcessTupleOperator(UDFOperator):
          BATCH_SIZE = 10.0        # a float, not an int
   
          @overrides
          def process_tuple(self, tuple_: Tuple, port: int) -> 
Iterator[Optional[TupleLike]]:
              yield tuple_
      ```
   3. Run the workflow and read the error reported for the operator.
   
   Observed: `BATCH_SIZE cannot be {type(value))}.`
   Expected: the message names the supplied type, e.g. `BATCH_SIZE cannot be 
<class 'float'>.`
   
   Directly, without a workflow: call the validator with a float and inspect 
the `ValueError` message.
   
   ### Version/Branch
   
   1.3.0-incubating-SNAPSHOT (main)
   
   ### Commit Hash (Optional)
   
   _No response_
   
   ### What browsers are you seeing the problem on?
   
   _No response_
   
   ### Relevant log output
   
   ```shell
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to