Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mappers): Stream name can now be accessed in __alias__ context of stream maps #2701

Merged

Conversation

holly-evans
Copy link
Contributor

@holly-evans holly-evans commented Oct 3, 2024

Description

Allow users to reference the stream name in stream maps alias fields, under a special key:

{
    "stream_maps": {
        "*": {
            "__alias__": "'raw_' + __stream_name__"
        },
}

Related


📚 Documentation preview 📚: https://meltano-sdk--2701.org.readthedocs.build/en/2701/

Copy link

codspeed-hq bot commented Oct 3, 2024

CodSpeed Performance Report

Merging #2701 will not alter performance

Comparing holly-evans:issue-2283-use-stream-name-in-alias (4cbdfb1) with main (9bf104e)

Summary

✅ 6 untouched benchmarks

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.50%. Comparing base (9bf104e) to head (4cbdfb1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2701   +/-   ##
=======================================
  Coverage   90.50%   90.50%           
=======================================
  Files          62       62           
  Lines        4994     4994           
  Branches      974      974           
=======================================
  Hits         4520     4520           
  Misses        328      328           
  Partials      146      146           

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

singer_sdk/mapper.py Outdated Show resolved Hide resolved
@edgarrmondragon edgarrmondragon self-assigned this Oct 3, 2024
Copy link
Collaborator

@edgarrmondragon edgarrmondragon left a comment

Choose a reason for hiding this comment

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

This looks great, thanks @holly-evans!

singer_sdk/mapper.py Outdated Show resolved Hide resolved
Co-authored-by: Edgar Ramírez Mondragón <16805946+edgarrmondragon@users.noreply.github.com>
@edgarrmondragon edgarrmondragon changed the title feat(mappers): Access stream name in alias feat(mappers): Stream name can now be accessed in __alias__ context of stream maps Oct 3, 2024
@holly-evans holly-evans requested review from a team as code owners October 4, 2024 18:52
@holly-evans
Copy link
Contributor Author

@edgarrmondragon Added some docs! Left the version as TODO

@edgarrmondragon edgarrmondragon added this to the v0.42.0 milestone Oct 4, 2024
@edgarrmondragon
Copy link
Collaborator

Thanks @holly-evans!

@edgarrmondragon edgarrmondragon added this pull request to the merge queue Oct 4, 2024
Merged via the queue into meltano:main with commit 8a38e79 Oct 4, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Access stream name in __alias__
2 participants