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

bug/partition_json can't parse json file as one dictionary #1498

Closed
yuming-long opened this issue Sep 22, 2023 · 1 comment
Closed

bug/partition_json can't parse json file as one dictionary #1498

yuming-long opened this issue Sep 22, 2023 · 1 comment
Labels
bug Something isn't working json Related to partitioning JSON

Comments

@yuming-long
Copy link
Contributor

yuming-long commented Sep 22, 2023

Describe the bug
a user saw error while partition this json subject:

{
    "id": 1234,
    "description": "this is a test"
}

error:

Traceback (most recent call last):
  File "/Users/yumingl/develops/unstructured/test.py", line 7, in <module>
    elements = partition(filename="test.json")
  File "/Users/yumingl/develops/unstructured/unstructured/partition/auto.py", line 371, in partition
    raise ValueError(
ValueError: Detected a JSON file that does not conform to the Unstructured schema. partition_json currently only processes serialized Unstructured output.

To Reproduce
save subject above as file test.json and run with elements = partition(filename="test.json")

Expected behavior
should get return elements output from the dict

Additional context
The bug here is we only accept list of dict pattern for json files, and we should expand it to accept json file with only one dictionary or more potential pattern of json file

@yuming-long yuming-long added the bug Something isn't working label Sep 22, 2023
@scanny scanny added the json Related to partitioning JSON label Nov 21, 2023
@MthwRobinson
Copy link
Contributor

Closing this in favor of #1038

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working json Related to partitioning JSON
Projects
None yet
Development

No branches or pull requests

3 participants