-
Notifications
You must be signed in to change notification settings - Fork 61
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
Kafka Trigger Rich Type #13
Conversation
pass | ||
|
||
@abc.abstractmethod | ||
def timestamp(self) -> typing.Optional[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be better to have this as datetime.datetime
rather than str
?
return self.__topic | ||
|
||
@property | ||
def timestamp(self) -> typing.Optional[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above. Better to have this as datetime.datetime
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I keep this as datetime, depending on the format used by the sender, the trigger conversion fails. So its best to not handle the variety of datetimes and keep it as string. This also applies to the event hub trigger.
pass | ||
|
||
@abc.abstractmethod | ||
def key(self) -> typing.Optional[str]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be decorated with @property
as well. Same applies for the properties below this as well since they do not follow method conventions.
Closing this PR. Please submit a new PR to https://github.com/Azure/azure-functions-kafka-extension |
Supporting rich type KafkaEvent for KafkaTrigger in Python
Azure/azure-functions-kafka-extension#10