Currently, users have their namespace automatically created for them at python.kafka.modelname
|
@staticmethod |
|
def schema_extra(schema: Dict[str, Any], |
|
model: Type['KafkaRecord']) -> None: |
|
schema['type'] = 'record' |
|
schema['name'] = schema.pop('title') |
|
schema['namespace'] = (f'python.kafka.' |
|
f'{schema["name"].lower()}') |
|
schema = process_properties(schema) |
|
schema.pop('properties') |
|
|
|
# Dynamically generated schemas might not have this field, |
|
# which is removed anyway. |
|
if 'required' in schema: |
|
schema.pop('required') |
|
update_optional_schema(schema=schema, model=model) |
We should allow users to define their own namespace.
something like,
class MyRecord(KafkaRecord):
name: str
@property
def namespace():
return 'my.name.space'
or as an argument to PandasToRecordsTransformer
Currently, users have their namespace automatically created for them at
python.kafka.modelnamepy2k/py2k/record.py
Lines 66 to 80 in 14d82e5
We should allow users to define their own namespace.
something like,
or as an argument to
PandasToRecordsTransformer