You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2019/08/13 23:14:59 UTC

[GitHub] [pulsar] marcusalmeida opened a new pull request #4946: [pulsar-functions][python-examples] Fixing python function example custom_object_function.py

marcusalmeida opened a new pull request #4946: [pulsar-functions][python-examples] Fixing python function example custom_object_function.py
URL: https://github.com/apache/pulsar/pull/4946
 
 
   ### Motivation
   
   Fixing Python examples for pulsar-functions custom_object_function.py
   
   ### Modifications
   
   Adding conversion of "str" to "bytes" using the methods "encode" and "decode" from string.
   
   To perform the tests run:
   ```sh
   $ bin/pulsar-admin functions create \
    --py $PULSAR_HOME/examples/python-examples/custom_object_function.py \
    --tenant public \
    --namespace default \
    --name custom_object \
    --inputs input-topic \
    --custom-serde-inputs '{"input-topic": "custom_object_function.CustomSerDe"}' \
    --output output-topic \
    --output-serde-classname custom_object_function.CustomSerDe \
    --classname custom_object_function.CustomObjectFunction 
    ```
   
   And trigger the function using the CLI "functions trigger" :
   ```sh
   $ pulsar-admin functions trigger \
     --name custom \
     --tenant public \ 
     --namespace default \
     --trigger-value "1,2"
   ```
   And should return:
    
   12, 26
   
    
   ### Does this pull request potentially affect one of the following parts:
   
   *If `yes` was chosen, please highlight the changes*
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API: no
     - The schema: no
     - The default values of configurations: no
     - The wire protocol: no
     - The rest endpoints: no
     - The admin cli options: no
     - Anything that affects deployment: no
   
   ### Documentation
   
     - Does this pull request introduce a new feature? no
     

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services