-
Notifications
You must be signed in to change notification settings - Fork 933
Made num_partitions optional #1515
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
42f8aa7 to
60d5685
Compare
60d5685 to
5b5ba72
Compare
src/confluent_kafka/src/Admin.c
Outdated
| goto err; | ||
| } | ||
| } | ||
| if (!newt->replica_assignment) { |
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.
Don't raise this error here. It should be in librdkafka or from the broker.
CHANGELOG.md
Outdated
| SASL PLAIN/SCRAM credentials that will be used for subsequent (new) connections to a broker (#1511). | ||
| - Wheels for Linux / arm64 (#1496). | ||
|
|
||
| - Added support for Default num_partitions(the field is optional now) in CreateTopics Admin API according to KIP-464. |
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.
Remove KIP-464 part
| } | ||
|
|
||
| if (newt->replica_assignment) { | ||
| if (newt->replication_factor != -1) { |
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.
Keep it as it is.
src/confluent_kafka/src/AdminTypes.c
Outdated
| { "num_partitions", T_INT, offsetof(NewTopic, num_partitions), 0, | ||
| ":py:attribute: Number of partitions (int)" }, | ||
| ":py:attribute: [OPTIONAL] Number of partitions (int).\n" | ||
| "Must be set to -1 or not be provided if a replica_assignment is specified" }, |
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.
src/confluent_kafka/src/Admin.c
Outdated
| goto err; | ||
| } | ||
|
|
||
| int t; |
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.
proper name.
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.
temp_partitions ?
src/confluent_kafka/src/AdminTypes.c
Outdated
| { "num_partitions", T_INT, offsetof(NewTopic, num_partitions), 0, | ||
| ":py:attribute: Number of partitions (int)" }, | ||
| ":py:attribute: Number of partitions (int).\n" | ||
| "Must be set to -1 if a replica_assignment is specified" }, |
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 we are enforcing this, then we don't need this condition.
if (newt->num_partitions == -1) {
t = PyList_Size(newt->replica_assignment);
} else {
t = newt->num_partitions;
}
We can use what's written in Java. In this way, its a suggestion.
The number of partitions for the new topic or -1 if a replica assignment has been specified.
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.
We are not enforcing to keep backward compatibility, we need the check so prior code does not break.
CHANGELOG.md
Outdated
| SASL PLAIN/SCRAM credentials that will be used for subsequent (new) connections to a broker (#1511). | ||
| - Wheels for Linux / arm64 (#1496). | ||
|
|
||
| - Added support for Default num_partitions(the field is optional now) in CreateTopics Admin API. |
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.
Remove "(the field is optional now)"
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.
Good Job.
LGTM!
* Default New Topic Params -> num_partitions optional * Added to Changelog * Keeping one source of truth * Made unit tests and Integration bounded to scope of python client * Changelog * Unit tests removed from Integration test * Flake8 * Review Comments Addressed * flake8 and whitespace changes * Whitespace Changes * flake8 * Whitespaces * Whitespace * PR comment addressal * PR comment addressal * PR comment addressal * PR comment Addressal
No description provided.