-
Notifications
You must be signed in to change notification settings - Fork 83
Infer schemas and coerce data for table cells #346
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
Merged
Merged
Changes from all commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
ea741fe
Stop using {typed: true} for csv and tsv
libbey-observable 558a6a6
Infer schema if none exists
libbey-observable ba09d45
Add schema validity check to address #9673
libbey-observable 3a3f5a1
Update tests
libbey-observable e151efd
Handle sources that are arrays of primitives
libbey-observable ec38311
Formatting
libbey-observable 6e9d64e
Quick updates based on feedback
libbey-observable 799398f
With Mike F's coercion
libbey-observable 5f30887
Remove new validity check fn and use existing
libbey-observable eb7008a
Don't mutate source
libbey-observable 3786837
Don't mutate row
libbey-observable 81018d4
Add exported fn to index.js
libbey-observable 3ec692b
Apply user-selected types and update schema
libbey-observable 2aaaad0
Combine into one regex
libbey-observable 4bd58bf
Update handling of "other" and use d3.greatest
libbey-observable bf97713
Fix tests
libbey-observable afe5241
Small fixes
libbey-observable f5c648b
More coercion
libbey-observable 740d860
Fix test
libbey-observable 9ddd352
Try supporting number coercion into dates
libbey-observable bfd138c
Try with value.toString
libbey-observable 1e820ec
Fixes and allowing for soft coercion
libbey-observable 28a6aaf
Fix test
libbey-observable 0c2a3ca
Formatting
libbey-observable 8884734
Remove export
libbey-observable a95a1bb
Update number and date coercion
libbey-observable c7583f7
Infer integers even if type is number
libbey-observable b9aceae
Coercion improvements
libbey-observable 41941c5
Add unit tests
libbey-observable 7ee0456
Formatting
libbey-observable fa60ecc
Fix bug
libbey-observable 1382c0b
Move coercion outside of loop
libbey-observable ac1219e
Perform intended check
libbey-observable 9d2c39f
Update BigInt coercion and tests
libbey-observable c22c781
Update handling of whitespace
libbey-observable f44e3ef
Improve handling of ints, BigInts, and numbers
libbey-observable 060f21d
Update coercion to arrays and objects
libbey-observable ac1d365
Infer bigints from strings
libbey-observable fc2b128
Check percentage of values conforming to inferred type
libbey-observable 9e53e61
Remove soft coercion option
libbey-observable 43b073b
Work with all keys present in data source
libbey-observable 7444123
Add inferred property to schema elements
libbey-observable 99e985e
Support raw type
libbey-observable 31048d6
Remove stray options
libbey-observable 6acab1d
Don't mutate schema
libbey-observable bbe7cf3
Rename variable
libbey-observable 19e3eef
Remove unnecessary check
libbey-observable 72f681b
Use schema rather than object keys
libbey-observable fc40237
Updates based on feedback
libbey-observable c5e070c
Don't getAllKeys if we have columns
libbey-observable a4443e3
Don't export for now
libbey-observable 834aa71
Don't mutate columns
libbey-observable 9b56371
Formatting
libbey-observable 9dec278
Remove unnecessary inferFromPrimitive function
libbey-observable c2a20db
Update string coercion
libbey-observable 2956af9
Update boolean coercion
libbey-observable e92247b
Remove stringValue
libbey-observable e45a130
Remove coercion for some types
libbey-observable 35579dd
Move promotion of arrays of primitives into loadTableDataSource
libbey-observable 6590f3b
Merge branch 'main' of https://github.com/observablehq/stdlib into li…
libbey-observable c3384d3
Fix names test
libbey-observable b5e10c7
Update coercion of numbers and dates
libbey-observable 6bee09b
Don't coerce when type is array, object, buffer, or other
libbey-observable caba589
Add isDataArray check before arrayIsPrimitive
libbey-observable f8a2544
Handle whitespace-only strings as well
libbey-observable b771cc0
Tighten up date regex and use test instead of match
libbey-observable 3055ebb
Repeat date regex when coercing
libbey-observable 750ef2a
Move bulk of inference to new inferType function
libbey-observable 3131fdb
Only use defined values in the denominator for 90% check
libbey-observable b77df67
Default to "other" rather than getting undefined as key on typeCounts
libbey-observable 9c32bd3
Add value check back and tighten up date regex a bit
libbey-observable 329465e
Update coercion to BigInt
libbey-observable 4600d6e
Fix date regex
libbey-observable 8eccbd8
Move date regex to constant
libbey-observable 154e20e
Move trim to inferType function
libbey-observable d82b2f8
Update coercion of dates
libbey-observable 2f2ee5e
Don't have inferType fall back to "other"
libbey-observable 6eae9d3
Coerce empty strings to null when type is "date"
libbey-observable 30ba6e5
Case-insensitive boolean inference/coercion
libbey-observable 7d0f114
Allow multiple types to be counted during inference
libbey-observable 9bff937
Update src/table.js
libbey-observable 5c4bc45
Update src/table.js
libbey-observable 8344ef6
Clean up trim and lower casing
libbey-observable 0b21fac
Use trimmed string in filter
libbey-observable 9f9a3f2
checkpoint
mbostock 543d55b
tweaks to inferSchema
mbostock 63ea079
combine loops!
mbostock 89e62c6
whitespace, bigint fixes
mbostock f3a4ad8
prEtTieR
mbostock 9a56e67
stricter string coercion
mbostock 326f542
Handle column of nulls
libbey-observable File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.