question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support `keep_key` in `Grouper`?

See original GitHub issue

IterKeyZipper has an option to keep the key that was zipped on:

https://github.com/pytorch/data/blob/2cf1f208e76301f3e013b7569df0d75275f1aaee/torchdata/datapipes/iter/util/combining.py#L53

Is this something we want to support going forward? If yes, it would be nice to have this also on Grouper and possibly other similar datapipes. That would come in handy in situations if the key is used multiple times for example if we have a IterKeyZipper after an Grouper.

Additional Context for New Contributors

See comment below

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
NicolasHugcommented, Mar 28, 2022

I took a quick look at this issue. I wonder if it would make sense to instead avoid the overlap between keep_key and merge_fn? For example we could remove the keep_key parameter, and instead let the merge_fn function accept key, source_dp_item, ref_dp_item ? Then passing keep_key=True would be equivalent to passing

merge_fn = lambda key, source_dp_item, ref_dp_item: (key, source_dp_item, ref_dp_item)
1reaction
ejguancommented, Mar 29, 2022

Perhaps I’m missing something but it looks like merge_fn isn’t really necessary since it can be achieved just as easily with a subsequent call to Mapper?

Yeah. When IterKeyZipper starts to support multiple datapipes, the merge_fn is not really useful. IIRC, merge_fn is used as a syntax sugar for a sequence of IterKeyZipper.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ShapeShift's KeepKey Support Grows
The KeepKey is a physical hardware device that helps protect users' funds from hackers and thieves. It uses wallet software located on the ......
Read more >
Restoring The KeepKey Hardware Wallet To Software ...
Different wallets are designed to use different default paths. The missing wallet balances are in the wallets not supporting the specific paths.
Read more >
10 Best Hardware Wallet Reviews (2023 Updated)
KeepKey Hardware Wallets. Pros: Beautifully designed, in-wallet exchange via Shapeshift. Cons: Not enough coins supported.
Read more >
KeepKey Settings
Access KeepKey Settings; Change The Device Label; Change The PIN; Access Advanced Settings; Change The Device Timeout; Enable Passphrase; Wipe ...
Read more >
Keepkey Supported Coins and Cryptocurrency | 2022 Update
ShapeShift acquired KeepKey in 2017, and the feature of cryptocurrency swapping has been implemented ever since. Shapeshift has also added a new feature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found