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

Numeric-like values with hyphens (96777-8) in CSV fields split into arrays in JSON output #1714

Open
megin1989 opened this issue Dec 2, 2024 · 0 comments

Comments

@megin1989
Copy link

We are using Frictionless to process CSV files, and we encountered an issue where certain fields with numeric-like values containing hyphens (e.g., 96777-8) are incorrectly split into arrays when converted to JSON output.

For example, a CSV field with the value 96777-8 gets represented in the JSON output as:
"SCREENING_CODE": [ 96777, 8 ]
Expected behavior: The value should remain as is in the JSON output:

"SCREENING_CODE": "96777-8"

Steps to Reproduce:
Create a CSV file (example.csv) with the following content:

SCREENING_CODE
96777-8

Use the extract or validate method to process the CSV:

from frictionless import extract
rows = extract('example.csv')
print(rows)

Observe the resulting JSON output:

[
    {
        "SCREENING_CODE": [
            96777,
            8
        ]
    }
]

Expected Behavior:
The output should preserve the original value as a string:

[
    {
        "SCREENING_CODE": "96777-8"
    }
]
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

No branches or pull requests

1 participant