Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for python function #70

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tuteng
Copy link
Member

@tuteng tuteng commented Apr 1, 2021

  • Add example for python function

@tuteng tuteng requested review from a team as code owners April 1, 2021 10:07
└── serde.py
```

In python, if a folder contains `__init__` file, we call it a package, python_function and pyserde are both packages. Compressing `python_function` directory will generate `python_function.zip`.
Copy link

@Jennifer88huang-zz Jennifer88huang-zz Apr 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In python, if a folder contains `__init__` file, we call it a package, python_function and pyserde are both packages. Compressing `python_function` directory will generate `python_function.zip`.
In Python, if a folder contains `__init__` file, it is a package. In this project structure, the `python_function` and `pyserde` are both packages. Compressing `python_function` directory generates the `python_function.zip` file.

Copy link
Contributor

@Huanli-Meng Huanli-Meng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave my comment. PTAL.

@@ -0,0 +1,47 @@
# python-function

This is an example of how to use the python function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is an example of how to use the python function.
This example describes how to use the Python function.


This is an example of how to use the python function.

## Project Structure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Project Structure
## Project structure

In python, if a folder contains `__init__` file, we call it a package, python_function and pyserde are both packages. Compressing `python_function` directory will generate `python_function.zip`.

## How to use

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section describes how to use the Python function.


## How to use

### Start pulsar standalone
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Start pulsar standalone
### Start Pulsar in standalone mode

## How to use

### Start pulsar standalone

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example shows how to start Pulsar in Docker.

bin/pulsar standalone
```

### Start python function by use zip package
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Start python function by use zip package
### Start Python function
This example shows how to start Python function through a ZIP package.

--output-serde-classname python_function.pyserde.serde.CustomSerDe \
--output output-topic-3
```
Replace `YOUR-PATH` with your file path.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Replace `YOUR-PATH` with your file path.
Replace the `YOUR-PATH` parameter with your file path.

```
Replace `YOUR-PATH` with your file path.

### Run produce and consume
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Run produce and consume
### Run producer and consumer
This example shows how to run a producer and a consumer.

@@ -0,0 +1,47 @@
# python-function

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# python-function
# Python function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants