Skip to content

WIP: Test with upstream simpleeval PR for checking disallowed items at name-resolution boundary#3596

Closed
edgarrmondragon wants to merge 1 commit into
mainfrom
fix/simpleeval-check-at-names-boundary
Closed

WIP: Test with upstream simpleeval PR for checking disallowed items at name-resolution boundary#3596
edgarrmondragon wants to merge 1 commit into
mainfrom
fix/simpleeval-check-at-names-boundary

Conversation

@edgarrmondragon
Copy link
Copy Markdown
Collaborator

@edgarrmondragon edgarrmondragon commented Apr 8, 2026

Related

Summary by Sourcery

Wrap simpleeval datetime and json functions with module wrappers and pin simpleeval to a specific upstream Git revision for boundary checking behavior.

Enhancements:

  • Expose datetime and json to the mapper expression evaluator via simpleeval.ModuleWrapper instead of raw modules.

Build:

  • Depend on a specific upstream simpleeval Git revision with the fix/check-at-names-boundary branch.

@edgarrmondragon edgarrmondragon self-assigned this Apr 8, 2026
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Apr 8, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Wraps datetime and json modules with simpleeval.ModuleWrapper when exposing them as simpleeval functions, and pins the simpleeval dependency to a specific upstream Git revision that implements name-boundary checks for disallowed items.

Class diagram for mapper functions using simpleeval ModuleWrapper

classDiagram
    class Mapper {
        +functions() dict
        +_eval()
    }

    class SimpleEval {
        +DEFAULT_FUNCTIONS dict
        +ModuleWrapper(module)
    }

    class DatetimeModule
    class JsonModule

    Mapper ..> SimpleEval : uses
    Mapper ..> DatetimeModule : wraps
    Mapper ..> JsonModule : wraps

    Mapper : functions() clones SimpleEval.DEFAULT_FUNCTIONS
    Mapper : functions()["datetime"] = SimpleEval.ModuleWrapper(DatetimeModule)
    Mapper : functions()["json"] = SimpleEval.ModuleWrapper(JsonModule)
Loading

File-Level Changes

Change Details Files
Adjust simpleeval function exposure to use safe module wrappers for datetime and json.
  • Replace direct exposure of the datetime module with simpleeval.ModuleWrapper(datetime) in the mapping evaluation functions registry.
  • Replace direct exposure of the json module with simpleeval.ModuleWrapper(json) in the mapping evaluation functions registry.
singer_sdk/mapper.py
Point simpleeval dependency to a specific upstream Git revision with boundary-check behavior.
  • Add simpleeval as a git-based dependency referencing the meltano/simpleeval repository and the fix/check-at-names-boundary revision in pyproject configuration.
  • Refresh uv.lock to reflect the new simpleeval source and version resolution.
pyproject.toml
uv.lock

Possibly linked issues

  • #bug: They both address simpleeval 1.0.5 breaking module-based stream_maps expressions by wrapping modules and pinning a fixed simpleeval version.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.73%. Comparing base (c1691f3) to head (deb6326).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3596   +/-   ##
=======================================
  Coverage   93.73%   93.73%           
=======================================
  Files          73       73           
  Lines        5890     5890           
  Branches      723      723           
=======================================
  Hits         5521     5521           
  Misses        274      274           
  Partials       95       95           
Flag Coverage Δ
core 82.13% <ø> (ø)
end-to-end 75.50% <ø> (ø)
optional-components 42.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Apr 8, 2026

Merging this PR will not alter performance

✅ 8 untouched benchmarks


Comparing fix/simpleeval-check-at-names-boundary (deb6326) with main (c1691f3)

Open in CodSpeed

…t name-resolution boundary

Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
@edgarrmondragon edgarrmondragon force-pushed the fix/simpleeval-check-at-names-boundary branch from 9280e7d to deb6326 Compare April 16, 2026 18:19
@edgarrmondragon edgarrmondragon deleted the fix/simpleeval-check-at-names-boundary branch April 24, 2026 18:55
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.

chore: Support simpleeval 1.0.5+ by implementing ModuleWrapper for modules exposed to stream maps expressions

1 participant