Skip to content

[python] Align ExternalPathProvider with Java multi-strategy support.#8104

Open
zhoulii wants to merge 3 commits into
apache:masterfrom
zhoulii:feature/external-path-provider-python
Open

[python] Align ExternalPathProvider with Java multi-strategy support.#8104
zhoulii wants to merge 3 commits into
apache:masterfrom
zhoulii:feature/external-path-provider-python

Conversation

@zhoulii
Copy link
Copy Markdown
Member

@zhoulii zhoulii commented Jun 3, 2026

Purpose

close #8103

Tests

value = self.options.get(CoreOptions.DATA_FILE_EXTERNAL_PATHS_WEIGHTS, default)
if not value:
return None
return [int(w.strip()) for w in value.split(",") if w.strip()]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please validate the parsed weights here, matching Java CoreOptions.externalPathWeights(). Currently zero or negative weights are accepted and then WeightedExternalPathProvider builds invalid cumulative weights: for example 0,0 makes total_weight zero so every random value maps past the last cumulative entry and all files go to the last path, while 10,-5 makes the second path unreachable. Java rejects non-positive weights, so Python should raise for <= 0 too.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

thanks, fixed

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.

[Feature] [python] Align ExternalPathProvider with Java multi-strategy support

2 participants