@W-23751657: Add external module resolution to Python binding - #167
Merged
Conversation
svacas
reviewed
Aug 25, 2026
svacas
left a comment
Contributor
There was a problem hiding this comment.
Found one issue that should be addressed before merging.
P2: Directory resolver fails when base_dir contains ..
modules_from_directory() (
data-weave-cli/native-lib/python/src/dataweave/resolver.py
Lines 27 to 40 in 73c4bf6
which preserves .. path segments. The candidate is later normalized with os.path.abspath(), so this containment check rejects valid files:
candidate.relative_to(lexical_root)
For example, an existing module resolved through a base path such as /tmp/modules/../modules incorrectly returns None.
Normalize the lexical root without resolving symlinks:
lexical_root = Path(os.path.abspath(base_dir))
Please also add a regression test using a valid base directory containing ...
All current CI checks pass, and I found no other blocking issues in callback lifetime, thread attachment, execution serialization, or cleanup handling.
svacas
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DataWeaveinstancesrun_script_with_resolverABI with safe callback, buffer, concurrency, re-entry, and isolate lifecycle handlingAPI
Custom module resolution is intentionally limited to synchronous
DataWeave.run(). Module-level convenience functions and streaming APIs remain resolver-less.TCK impact
runtime/module-singleton-out.jsonremains excluded because the approved shared fixture lacks its three singleton modules.Validation
./gradlew native-lib:pythonTest(147 passed)./gradlew native-lib:stageTckSuites native-lib:pythonTck(719 pytest passes, 31 skips, 19 xfails; TCK accounting 729/729)./gradlew native-lib:test -PskipNodeTests=true -PskipPythonTests=true --rerun-tasks./gradlew native-lib:buildPythonWheelplus isolated virtualenv import smoke testgit diff --checkScope
native-lib/node