chore: Merge branch 'v0.54' into main#3656
Merged
Merged
Conversation
…ON forces _sdc metadata columns (#3650) SSIA ## Summary by Sourcery Bug Fixes: - Include the stream name in the log message emitted when ACTIVATE_VERSION forces _sdc metadata columns to be added. --------- Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Prepare MeltanoSDK `v0.54.3` for release. Checklist: - [x] Check that the right version is set in all the files. - [x] Groom the changelog for wording or missing entries. - [ ] Merge this PR once everything looks good. [Release Draft](https://github.com/meltano/sdk/releases/tag/untagged-7e449f29d1fdd9b4737f) ## Summary by Sourcery Prepare the 0.54.3 release of the Meltano SDK. Bug Fixes: - Document a fix ensuring stream names are included in log messages when ACTIVATE_VERSION forces _sdc metadata columns. Enhancements: - Bump SDK version references from 0.54.2 to 0.54.3 across project configuration, templates, and documentation metadata. --------- Co-authored-by: edgarrmondragon <16805946+edgarrmondragon@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…ed with stream maps (#3654) SSIA ## Summary by Sourcery Ensure ACTIVATE_VERSION messages emitted by mapped streams respect configured stream aliases instead of always using the original stream name. Bug Fixes: - Fix ACTIVATE_VERSION emission to use each stream map alias and skip mappings that remove records. Tests: - Enable ACTIVATE_VERSION message emission in mapped stream tests and update JSONL snapshots to validate correct behavior with stream aliases. Signed-off-by: Edgar Ramírez Mondragón <edgarrm358@gmail.com>
Prepare MeltanoSDK `v0.54.4` for release. Checklist: - [x] Check that the right version is set in all the files. - [x] Groom the changelog for wording or missing entries. - [x] Merge this PR once everything looks good. [Release Draft](https://github.com/meltano/sdk/releases/tag/untagged-5c952353a22391e5f9eb) ## Summary by Sourcery Release version 0.54.4 of the SDK and update references across the project. Bug Fixes: - Ensure emitted ACTIVATE_VERSION messages respect stream aliases configured via stream maps. Build: - Bump singer-sdk dependency to v0.54.4 in all cookiecutter templates and project metadata. Documentation: - Update changelog with v0.54.4 entry and adjust documentation config and templates to reference the new version. --------- Co-authored-by: edgarrmondragon <16805946+edgarrmondragon@users.noreply.github.com> Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
Contributor
Reviewer's GuideAdjusts ACTIVATE_VERSION emission to respect stream map aliases while skipping removed streams, updates mapped stream tests and snapshots accordingly, and bumps the SDK and templates to version 0.54.4 with associated docs and metadata tweaks. Sequence diagram for ACTIVATE_VERSION emission with stream map aliasessequenceDiagram
participant Tap as Tap
participant Stream as Stream
participant StreamMap as StreamMap
Tap->>Stream: _write_activate_version_message(full_table_version)
loop stream_maps
Stream->>StreamMap: access stream_alias
alt [stream_map is RemoveRecordTransform]
Stream-->>StreamMap: skip
else [stream_map is not RemoveRecordTransform]
Stream->>Tap: write_message(ActivateVersionMessage(stream_alias, full_table_version))
end
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've found 2 issues, and left some high level feedback:
- In
_write_activate_version_message, consider preserving the previous behavior for unmapped streams (e.g., whenself.stream_mapsis empty) so that a non-mapped stream still emits anACTIVATE_VERSIONmessage forself.namerather than silently emitting nothing. - Now that
ACTIVATE_VERSIONgoes throughself._tap.write_messageinstead ofsinger.write_message, double-check whether this path should also be used (or abstracted) for other message types for consistency, or if there are cases where a directsinger.write_messageshould still be used.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `_write_activate_version_message`, consider preserving the previous behavior for unmapped streams (e.g., when `self.stream_maps` is empty) so that a non-mapped stream still emits an `ACTIVATE_VERSION` message for `self.name` rather than silently emitting nothing.
- Now that `ACTIVATE_VERSION` goes through `self._tap.write_message` instead of `singer.write_message`, double-check whether this path should also be used (or abstracted) for other message types for consistency, or if there are cases where a direct `singer.write_message` should still be used.
## Individual Comments
### Comment 1
<location path="singer_sdk/streams/core.py" line_range="858-869" />
<code_context>
- singer.ActivateVersionMessage(
- stream=self.name,
- version=full_table_version,
+ for stream_map in self.stream_maps:
+ if isinstance(stream_map, RemoveRecordTransform):
+ continue
+
+ self._tap.write_message(
+ singer.ActivateVersionMessage(
+ stream=stream_map.stream_alias,
+ version=full_table_version,
+ )
)
</code_context>
<issue_to_address>
**suggestion (bug_risk):** Consider deduplicating stream aliases before emitting ACTIVATE_VERSION messages.
Because multiple entries in `self.stream_maps` can share a `stream_alias`, this loop may now emit several `ActivateVersionMessage`s for the same logical stream, unlike the previous one-per-stream behavior. To avoid confusing downstream consumers or bloating the state log, consider deduplicating aliases (e.g., track them in a `set`) and emit a single activate message per unique alias.
```suggestion
def _write_activate_version_message(self, full_table_version: int) -> None:
"""Write out an ACTIVATE_VERSION message."""
seen_aliases: set[str] = set()
for stream_map in self.stream_maps:
if isinstance(stream_map, RemoveRecordTransform):
continue
stream_alias = stream_map.stream_alias
if stream_alias in seen_aliases:
continue
seen_aliases.add(stream_alias)
self._tap.write_message(
singer.ActivateVersionMessage(
stream=stream_alias,
version=full_table_version,
)
)
```
</issue_to_address>
### Comment 2
<location path="CHANGELOG.md" line_range="18" />
<code_context>
### 🐛 Fixes
-- [#3650](https://github.com/meltano/sdk/issues/3650) Ensure stream name is included in log message when ACTIVATE_VERSION forces \_sdc metadata columns.
+- [#3650](https://github.com/meltano/sdk/issues/3650) Ensure stream name is include in log message when ACTIVATE_VERSION forces \_sdc metadata columns
## v0.54.2 (2026-05-18)
</code_context>
<issue_to_address>
**issue (typo):** Typo: use "included" instead of "include".
Update the text to: `Ensure stream name is included in log message when ACTIVATE_VERSION forces _sdc metadata columns`.
```suggestion
- [#3650](https://github.com/meltano/sdk/issues/3650) Ensure stream name is included in log message when ACTIVATE_VERSION forces _sdc metadata columns
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3656 +/- ##
=======================================
Coverage 93.89% 93.90%
=======================================
Files 73 73
Lines 5949 5952 +3
Branches 728 730 +2
=======================================
+ Hits 5586 5589 +3
Misses 270 270
Partials 93 93
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
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.
SSIA
Summary by Sourcery
Honor stream map aliases when emitting ACTIVATE_VERSION messages and bump the SDK version to 0.54.4.
Bug Fixes:
Enhancements:
Tests: