Skip to content

fix(python): import union cases for reflection - #5028

Merged
dbrattli merged 2 commits into
mainfrom
fix/python-union-reflection-imports
Sep 30, 2026
Merged

dbrattli merged 2 commits into
mainfrom
fix/python-union-reflection-imports

Conversation

@dbrattli

@dbrattli dbrattli commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • resolve Python reflection union case references through the shared import-aware helper
  • import all Result and Choice case classes needed by reflection metadata
  • handle System.Text.Rune reflection metadata as a non-generic BCL type
  • add regressions for reflected Result record fields and Choice type information

Testing

  • ./build.sh test python --skip-fable-library-core
  • dotnet build src/Fable.Transforms/Fable.Transforms.fsproj --no-restore -v:minimal

Fixes #5025

Fixes #5025

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Python Type Checking Results (Pyright)

Metric Value
Total errors 34
Files with errors 4
Excluded files 4
New errors ✅ No
Excluded files with errors (4 files)

These files have known type errors and are excluded from CI. Remove from pyrightconfig.ci.json as errors are fixed.

File Errors Status
temp/tests/Python/test_hash_set.py 18 Excluded
temp/tests/Python/test_applicative.py 12 Excluded
temp/tests/Python/test_nested_and_recursive_pattern.py 2 Excluded
temp/tests/Python/fable_modules/thoth_json_python/encode.py 2 Excluded

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dbrattli
dbrattli merged commit 9632589 into main Sep 30, 2026
44 checks passed
@dbrattli
dbrattli deleted the fix/python-union-reflection-imports branch September 30, 2026 17:50
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.

[Python] Reflection on Result and Choice raises NameError: their case classes aren't imported

1 participant