Skip to content

🐛 Map: restore .item as deprecated alias - #815

Merged
GeigerJ2 merged 1 commit into
aiidateam:mainfrom
GeigerJ2:fix/restore-map-item-deprecated
Aug 28, 2026
Merged

GeigerJ2 merged 1 commit into
aiidateam:mainfrom
GeigerJ2:fix/restore-map-item-deprecated

Conversation

@GeigerJ2

Copy link
Copy Markdown
Contributor

TL;DR Restore Map.item (and the placeholder kwarg) as deprecated aliases so 0.9.0 doesn't break 0.8.1 downstream.

#792 dropped map_zone.item for .value/.key, reasoning "with no stable release, z.item is dropped outright." But v0.8.1 shipped .item, so that removed a released public API with no deprecation, and 0.8.1 code using map_zone.item.value/.key breaks on upgrade.

Ahead of the 0.9.0 release:

  • Map.item returns the map-item outputs namespace again, emitting a DeprecationWarning pointing to .value/.key, and resolving to the same sockets.
  • Map(source, placeholder=...) accepts placeholder again, ignored with a warning, so a 0.8.1-style call doesn't TypeError (it's been a no-op since Update map #510).

Tests assert both aliases still work and warn.

From a v0.8.1..main audit, .item was the only user-facing public break in the 17 PRs since 0.8.1. The one non-shimmable change is #787's stricter task-name validation (intentional; only affects non-identifier task names).

removed `.item` outright, on the premise that no stable release had it.
v0.8.1 did ship `.item`, so this removed a released public API with no
deprecation path and breaks downstream code on upgrade.

Restore `Map.item` as a property returning the map-item outputs
namespace (so `map_zone.item.value` / `.item.key` work again), emitting
a DeprecationWarning that points to `.value` / `.key`. Also accept the
`placeholder` keyword on the `Map` context manager again, ignored with a
warning, so a 0.8.1-style `Map(source, placeholder=...)` call does not
raise `TypeError` (the argument has been a no-op since aiidateam#510).

Keeps the upcoming 0.9.0 release backward-compatible with 0.8.1's Map
API while nudging users to the new spelling.
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d676d822-4444-4448-9b03-7412ef93d8f4

📥 Commits

Reviewing files that changed from the base of the PR and between 32ea9af and 96a0a0a.

📒 Files selected for processing (3)
  • src/aiida_workgraph/manager.py
  • src/aiida_workgraph/tasks/builtins.py
  • tests/test_map.py

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Map API now accepts the deprecated placeholder argument with a warning. The Map.item property restores the deprecated socket alias with a warning. Tests verify both compatibility paths.

Changes

Map API compatibility

Layer / File(s) Summary
Placeholder argument compatibility
src/aiida_workgraph/manager.py, tests/test_map.py
Map accepts the deprecated placeholder keyword, ignores its value, and emits a DeprecationWarning.
Deprecated item socket alias
src/aiida_workgraph/tasks/builtins.py, tests/test_map.py
Map.item returns the map-item outputs namespace and emits a DeprecationWarning. Tests compare its sockets with Map.value and Map.key.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 96a0a

The change restores deprecated Map aliases while preserving existing key/value behavior and warning callers to migrate; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the backward-compatibility changes to Map.item and the placeholder keyword, including the deprecation behavior and tests.
Title check ✅ Passed The title clearly identifies the main change: restoring Map.item as a deprecated alias. It is concise and directly related to the changeset.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 3 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.96%. Comparing base (32ea9af) to head (96a0a0a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #815      +/-   ##
==========================================
+ Coverage   90.94%   90.96%   +0.03%     
==========================================
  Files          46       46              
  Lines        3199     3207       +8     
==========================================
+ Hits         2909     2917       +8     
  Misses        290      290              

☔ View full report in Codecov by Harness.
📢 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.

@GeigerJ2
GeigerJ2 merged commit 42feffd into aiidateam:main Aug 28, 2026
7 checks passed
@GeigerJ2
GeigerJ2 deleted the fix/restore-map-item-deprecated branch August 28, 2026 08:45
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.

2 participants