Skip to content

Conversation

@mahajanadhitya
Copy link
Contributor

No description provided.

@mahajanadhitya mahajanadhitya requested a review from a team as a code owner February 3, 2023 09:30
@mahajanadhitya mahajanadhitya force-pushed the feature/defaultnewtopicparams branch from 42f8aa7 to 60d5685 Compare February 3, 2023 17:22
@mahajanadhitya mahajanadhitya force-pushed the feature/defaultnewtopicparams branch from 60d5685 to 5b5ba72 Compare February 7, 2023 10:32
goto err;
}
}
if (!newt->replica_assignment) {
Copy link
Member

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.
Copy link
Member

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) {
Copy link
Member

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.

{ "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" },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

goto err;
}

int t;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proper name.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temp_partitions ?

{ "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" },
Copy link
Member

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.

Copy link
Contributor Author

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.
Copy link
Member

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)"

Copy link
Member

@pranavrth pranavrth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job.

LGTM!

@mahajanadhitya mahajanadhitya merged commit 17029ad into master Feb 11, 2023
@mahajanadhitya mahajanadhitya deleted the feature/defaultnewtopicparams branch February 11, 2023 08:08
emasab pushed a commit that referenced this pull request Jun 19, 2023
* 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
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.

3 participants