Skip to content

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

Merged
JingsongLi merged 3 commits into
apache:masterfrom
zhoulii:feature/external-path-provider-python
Jun 4, 2026
Merged

[python] Align ExternalPathProvider with Java multi-strategy support.#8104
JingsongLi merged 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

@zhoulii zhoulii force-pushed the feature/external-path-provider-python branch from 7f830c8 to e7182c5 Compare June 3, 2026 23:40
Copy link
Copy Markdown
Contributor

@JingsongLi JingsongLi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@JingsongLi JingsongLi merged commit 4e3c4b8 into apache:master Jun 4, 2026
6 checks passed
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