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

Kafka Trigger Rich Type #13

Closed

Conversation

priyaananthasankar
Copy link

Supporting rich type KafkaEvent for KafkaTrigger in Python
Azure/azure-functions-kafka-extension#10

pass

@abc.abstractmethod
def timestamp(self) -> typing.Optional[str]:
Copy link
Contributor

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]:
Copy link
Contributor

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?

Copy link
Author

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]:
Copy link
Contributor

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.

@pragnagopa
Copy link
Member

Closing this PR. Please submit a new PR to https://github.com/Azure/azure-functions-kafka-extension

@pragnagopa pragnagopa closed this Jun 17, 2019
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.

None yet

3 participants