-
Notifications
You must be signed in to change notification settings - Fork 13.8k
[FLINK-17256][python] Support keyword arguments in the PyFlink descriptor API #12013
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
Conversation
|
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community Automated ChecksLast check on commit c947260 (Thu May 07 03:07:44 UTC 2020) Warnings:
Mention the bot in a comment to re-run the automated checks. Review Progress
Please see the Pull Request Review Guide for a full explanation of the review process. DetailsThe Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required Bot commandsThe @flinkbot bot supports the following commands:
|
dianfu
left a comment
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.
@shuiqiangchen Thanks for the PR. Only a few minor comments.
| self._j_schema = self._j_schema.field(field_name, _to_java_type(field_type)) | ||
| return self | ||
|
|
||
| def fields(self, fields): |
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.
could you add a test case for this method?
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.
Ok, I will add it.
| def __init__(self): | ||
| def __init__(self, version=None, topic=None, properties=None, start_from_earliest=False, | ||
| start_from_latest=False, start_from_group_offsets=True, | ||
| specific_offsets_dict=None, start_from_timestamp=None, |
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.
rename to start_from_specific_offsets_dict?
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.
Yes, it would be much clearer for users to use the argument.
| def __init__(self, version=None, topic=None, properties=None, start_from_earliest=False, | ||
| start_from_latest=False, start_from_group_offsets=True, | ||
| specific_offsets_dict=None, start_from_timestamp=None, | ||
| sink_partitioner_fixed=True, sink_partitioner_round_robin=False, |
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.
It seems that the round robin is the default partitioner. Could you double check if this is the case?
47db51f to
f944068
Compare
|
The failed tests are not related to this PR. Have created ticket FLINK-17576 to tract that. |
What is the purpose of the change
Keyword arguments is a very commonly used feature in Python. We should support it in the PyFlink Descriptor API to make the API more user friendly for Python users.
Brief change log
Verifying this change
This change is already covered by existing tests in test_descriptors.py
Does this pull request potentially affect one of the following parts:
@Public(Evolving): ( no)Documentation