🐛 Map: restore .item as deprecated alias - #815
Conversation
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Map API now accepts the deprecated ChangesMap API compatibility
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to 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)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
TL;DR Restore
Map.item(and theplaceholderkwarg) as deprecated aliases so 0.9.0 doesn't break 0.8.1 downstream.#792 dropped
map_zone.itemfor.value/.key, reasoning "with no stable release,z.itemis dropped outright." But v0.8.1 shipped.item, so that removed a released public API with no deprecation, and 0.8.1 code usingmap_zone.item.value/.keybreaks on upgrade.Ahead of the 0.9.0 release:
Map.itemreturns the map-item outputs namespace again, emitting aDeprecationWarningpointing to.value/.key, and resolving to the same sockets.Map(source, placeholder=...)acceptsplaceholderagain, ignored with a warning, so a 0.8.1-style call doesn'tTypeError(it's been a no-op since Update map #510).Tests assert both aliases still work and warn.
From a
v0.8.1..mainaudit,.itemwas 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).