Skip to content

Conversation

@dongwonmoon
Copy link

@dongwonmoon dongwonmoon commented Nov 7, 2025

@dongwonmoon dongwonmoon force-pushed the bug/json-normalize-int-key branch from f24285a to 84233a2 Compare November 7, 2025 16:20
@dongwonmoon
Copy link
Author

Hi reviewers,

P.S. While working on this fix, I noticed that the type hint for the meta parameter is currently specified as str | list[str | list[str]].

My PR ensures that non-string keys (like the int key in our test case) are handled consistently, whether record_path is specified or not. This aligns with the existing behavior when record_path=None, which already supports non-string keys (mirroring pd.DataFrame's ability to have non-string column names).

I've kept this PR scoped strictly to fixing the TypeError and ensuring consistent behavior.

Would a separate, follow-up issue or PR to discuss updating the type hint (perhaps to something like Hashable or Any) to match this behavior be welcome? Just wanted to bring it to your attention.

Thanks!

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.

BUG: pd.json_normalize has inconsistent validation for non-string keys - accepts integers in some parameter combinations but rejects in others

1 participant