Skip to content

Instantly share code, notes, and snippets.

@lmmx
Last active November 6, 2025 00:57
Show Gist options
  • Select an option

  • Save lmmx/dc8f01157c97ff8bf6ef1f7ecc5d995f to your computer and use it in GitHub Desktop.

Select an option

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 6, 2025

Looking more closely at that function_item

funcs_types = funcs.explode("types").rename({"type":"symbol"}).with_columns(pl.col("types").struct.rename_fields(["field_type","named_field"])).unnest("types")
Screenshot from 2025-11-06 00-56-39
funcs_types.rename({"multiple":"_multiple","required":"_required"}).filter(pl.col("symbol") == "function_item").unnest("children")
funcs_types.rename({"multiple":"_multiple","required":"_required"}).filter(pl.col("symbol") == "function_item").unnest("children").explode("types")
funcs_types.rename({"multiple":"_multiple","required":"_required"}).filter(pl.col("symbol") == "function_item").unnest("children").explode("types").unnest("types")

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