-
Notifications
You must be signed in to change notification settings - Fork 283
feat: support union type for basic types #510
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
badmonster0
merged 114 commits into
cocoindex-io:main
from
chardoncs:expr-union-type-impl
Jun 21, 2025
Merged
Changes from 110 commits
Commits
Show all changes
114 commits
Select commit
Hold shift + click to select a range
5b33175
Add union type and JSON schema conversion
chardoncs a7f7e85
Add basic postgres conversion
chardoncs 7b959b9
Compact lines
chardoncs 6b6aae9
Workaround for JSON conversion in union
chardoncs bb18d97
Add stub impl for Python union conversion
chardoncs a2b5906
Add impl for python object union conversion
chardoncs 0e19865
Update error message
chardoncs 4cbd632
Rename type item
chardoncs 69cc231
Add str parsing method
chardoncs 3b386b6
Add union conversion for Qdrant
chardoncs 159e8e3
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 606d26e
Add basic string parsing for union type
chardoncs c68fd2a
Fix union conversion for Qdrant
chardoncs 839ee85
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 4752970
Replace if guards with matches
chardoncs b16d0f6
Add extra parsing for string
chardoncs c404388
Add rustdoc for parsing method
chardoncs 312ef53
Turn string parsing into a util function
chardoncs c2ebd88
Update union parsing for serde value
chardoncs 703565b
Add vector union type parsing for Qdrant
chardoncs d2d02b0
Switch to BTreeSet for union types
chardoncs 72537b8
Remove nested union detection
chardoncs f837121
Remove TODO: Support struct/table
chardoncs 2785e1c
Add union type helper struct
chardoncs a1f47a6
Add comments
chardoncs cca7d1f
Update Python type conversion for union type
chardoncs f9e9bec
Use reversed iteration for union type matching
chardoncs 189a52d
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs b1e1084
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 4ec510d
Add test cases for union fmt
chardoncs 9a31d2e
Update comments
chardoncs c168dcc
Add test cases
chardoncs 2e06096
Remove "undetected JSON" parsing
chardoncs 1e9d74c
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 780d154
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 0ffe380
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs f384c16
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 4463e52
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 69a0280
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 1d51d5c
Update union analysis in Python API
chardoncs efa1861
Add union type encoding for Python API
chardoncs 6294ecf
Add single type checking for union type analysis
chardoncs fd37218
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 052815a
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs 66a09ec
Update union type
chardoncs 385487f
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs f8eb3cc
Add union decoding
chardoncs bdd4b16
Revert "Add union decoding"
chardoncs 534c791
Update encoded type field
chardoncs e8b972e
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs beaa1c1
Update union types field in Python
chardoncs 39b6039
Merge branch 'cocoindex-io:main' into expr-union-type-impl
chardoncs fa2dd14
Merge branch 'main' into expr-union-type-impl
chardoncs 030281c
Update type serialization
chardoncs a037d9a
Revert "Update type serialization"
chardoncs 224cb5b
Merge branch 'main' into expr-union-type-impl
chardoncs d4916d2
Add `UnionVariant` and conversions in `BasicValue`
chardoncs 8869002
Merge branch 'main' into expr-union-type-impl
chardoncs 7f08070
Add union value binding for Postgres
chardoncs 0571e8c
Update type guessing for union from python object
chardoncs edeabe7
Replace direct return with break
chardoncs d194117
Use `Vec` to remove auto-sort
chardoncs fe4941b
Revert "Use `Vec` to remove auto-sort"
chardoncs 0850cdc
Merge branch 'main' into expr-union-type-impl
chardoncs 2775b28
Merge branch 'main' into expr-union-type-impl
chardoncs d649e0a
Merge branch 'main' into expr-union-type-impl
chardoncs 9677169
Use `Vec` for union type
chardoncs bf2811c
Add union processing for KuzuDB
chardoncs a5f6c6c
Update Cypher generation for union type
chardoncs d48f6c5
Use 0-based index for `val{i}`
chardoncs abb920e
Update tuple
chardoncs 09764e2
Merge branch 'main' into expr-union-type-impl
chardoncs b246485
Take values for JSON conversion for union
chardoncs 34d0ca3
Update variable name
chardoncs d029def
Use typed value conversion for union in Postgres
chardoncs ce45aaa
Replace union conversion with error in `from_pg_value()`
chardoncs 2c7d106
Update union conversion for Qdrant
chardoncs 1a78b48
Update `PyErr` message for union
chardoncs e8ed867
Move `UnionType` to `schema.rs` as `UnionTypeSchema`
chardoncs f577da7
Use `to_value()` for union value conversion
chardoncs 59f4bce
Use `bail!()` for early return
chardoncs 70d2010
Update error message for union tuple conversion
chardoncs a913522
Merge branch 'main' into expr-union-type-impl
chardoncs dd0d48f
Merge branch 'main' into expr-union-type-impl
chardoncs 549dc30
Move union type checking to the loop
chardoncs 240cf16
Replace `.ok_or_else()` with `.unwrap()`
chardoncs 4832227
Update union variant serialization
chardoncs 5c48526
Merge branch 'main' into expr-union-type-impl
chardoncs 2795d4b
Merge branch 'main' into expr-union-type-impl
chardoncs af45e67
Merge branch 'main' into expr-union-type-impl
chardoncs d093571
Match quote styling
chardoncs 866865c
Break infinite loops
chardoncs 6de65b5
Added a union test case
chardoncs 4bcc53d
Fix union typing
chardoncs 4157ff0
Merge branch 'main' into expr-union-type-impl
chardoncs 64cf435
Make `union_variant_types` optional
chardoncs e873f65
Merge branch 'main' into expr-union-type-impl
chardoncs ae6e5bc
Update test case
chardoncs d1205cf
Fix JSON seder and decoding
chardoncs f748cda
Add UUID union test cases
chardoncs 66b92b5
Add test cases for union type
chardoncs 4df4518
Merge branch 'main' into expr-union-type-impl
chardoncs e76f8e5
Update the offset datetime test case for unions
chardoncs 047978e
Merge branch 'main' into expr-union-type-impl
chardoncs 0e68c71
Remove union implementation for Kuzu
chardoncs 54cb4eb
Merge branch 'main' into expr-union-type-impl
chardoncs cae045c
Merge branch 'main' into expr-union-type-impl
chardoncs 986e5fc
Update `union_variant_types` typing
chardoncs dbe8c41
Merge branch 'main' into expr-union-type-impl
chardoncs 02b7e2a
Add union value serialization for `TypedValue`
chardoncs b236de8
Merge branch 'main' into expr-union-type-impl
chardoncs 5cc0fca
Update union tuple check for basic value
chardoncs bb75e46
Reformat files
chardoncs 77096bc
Remove explicit type for array, the type is obvious
chardoncs 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
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
chardoncs marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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
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
chardoncs marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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
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
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.
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.