Skip to content

Instantly share code, notes, and snippets.

@lmmx
Last active November 3, 2025 01:47
Show Gist options
  • Save lmmx/dc8f01157c97ff8bf6ef1f7ecc5d995f to your computer and use it in GitHub Desktop.
Save lmmx/dc8f01157c97ff8bf6ef1f7ecc5d995f to your computer and use it in GitHub Desktop.
Loaded node types into parquet via polars-genson via https://gist.github.com/lmmx/ed3dd70ea7997f27efa1ff31b625c0b1
@lmmx
Copy link
Author

lmmx commented Nov 3, 2025

>>> import polars as pl                                                                                                        
>>> import polars_genson                                                                                                       
>>> from pathlib import Path                                                                                                   
>>> json = Path("node-types.json").read_text()                                                                                 
>>> df = pl.DataFrame({"node_types": json})                                                                                    
>>> transformed = df.genson.normalise_json("node_types", wrap_root="node_types").explode("*").unnest("*") 
>>> transformed.write_parquet("node_types.parquet")
Screenshot from 2025-11-03 01-32-37

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment