Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse JSON documents with nested objects/lists correctly #10

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

andyantrim
Copy link
Contributor

Issue
JSON that contained a nested object or list

{
    "example": []
}

Would not parse correctly and cause an error.

Fix
When we parse JSON, we go through all the top level columns of the dataframe and use json.dumps on any that have a type of list, dict

Tests
Subscribed to recipes JSON on nyx-community, and was able to parse and answer questions on them

I need a healthy recipe that uses chicken as an ingredient

Final Answer:

  • Recipe Name: Grilled Chicken with Steamed Vegetables
  • Ingredients:
    • Chicken breasts: 2 pieces
    • Broccoli: 1 cup
    • Carrots: 1 cup
    • Olive oil: 1 tbsp
    • Salt: to taste
    • Pepper: to taste
  • Instructions:
    1. Season chicken with olive oil, salt, and pepper.
    2. Grill chicken for 6-7 minutes on each side until fully cooked.
    3. Steam broccoli and carrots until tender.
    4. Serve chicken with steamed vegetables.

@andyantrim andyantrim added the enhancement New feature or request label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants