gaoran10 opened a new pull request #12175:
URL: https://github.com/apache/pulsar/pull/12175
### Motivation
Currently, the python schema didn't support setting namespace in the schema
definition.
### Modifications
Support setting namespace in the python schema definition.
for example, add a special field `_namespace` for the custom Record to set
the namespace.
```
class User(Record):
_namespace = 'xxx.xxx.xxx'
name = String()
age = Integer()
```
The schema definition is like this.
```
{'name': 'User', 'namespace': 'xxx.xxx.xxx', 'type': 'record', 'fields':
[{'name': 'age', 'type': ['null', 'int']}, {'name': 'name', 'type': ['null',
'string']}]}
```
### Verifying this change
Add test to verify the schema definition.
### 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
Check the box below and label this PR (if you have committer privilege).
Need to update docs?
- [ ] doc-required
(If you need help on updating docs, create a doc issue)
- [ ] no-need-doc
(Please explain why)
- [ ] doc
(If this PR contains doc changes)
--
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]