Skip to content

Fix a bug where rdcards() doesn't work if you follow includes and return type dict - #53

Merged
twmacro merged 6 commits into
twmacro:masterfrom
rjyunis:bugfix/dict-type-rdcards-include
Jul 22, 2026
Merged

twmacro merged 6 commits into
twmacro:masterfrom
rjyunis:bugfix/dict-type-rdcards-include

Conversation

@rjyunis

@rjyunis rjyunis commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Good afternoon,

This corrects a small bug where rdcards() doesn't work when you request a return type of dict AND follow includes. When _rdinclude() returns (line 815), the values would already be a dictionary, so the for loop (line 826) val is a key (an int) instead of a list. This means len(val) on the following line doesn't work. If you just pass "array" to _rdinclude() instead, it will be read in correctly and converted later in the function.

I also cast key to int. Sometimes the keys are floats and I'm not sure why.

@rjyunis
rjyunis marked this pull request as draft July 21, 2026 21:45
@rjyunis

rjyunis commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

I'm marking this as ready to review, since the failing tests seem to be based on differences between python versions rather than code correctness. The cases fail even when I revert my changes.

@rjyunis
rjyunis marked this pull request as ready for review July 21, 2026 22:13
@twmacro
twmacro merged commit 4616515 into twmacro:master Jul 22, 2026
4 of 13 checks passed
@twmacro

twmacro commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Thanks for the update, @rjyunis! I'm not sure why some tests aren't passing, but it seems unrelated to these updates.

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