Skip to content

fix: resolve mypyc compilation bugs, exception handling, filter providers, and vector distance SQL generation#401

Merged
cofin merged 17 commits intomainfrom
fix/bugs-n-stuff
Apr 6, 2026
Merged

fix: resolve mypyc compilation bugs, exception handling, filter providers, and vector distance SQL generation#401
cofin merged 17 commits intomainfrom
fix/bugs-n-stuff

Conversation

@cofin
Copy link
Copy Markdown
Member

@cofin cofin commented Mar 23, 2026

Summary

  • Fixed mypyc compilation bugs: Refactored async iterators to avoid fragile mypyc coroutine state machines. Removed unstable __del__ methods causing C-level race conditions during GC.
  • Fixed exception handling: Wrapped execute methods in exception handler so mapped SQLSpec exceptions propagate correctly (instead of raw driver exceptions leaking through).
  • Fixed IN/NotIn filter providers: create_filter_dependencies with in_fields now correctly produces InCollectionFilter instances. Fixed FieldNameType resolution for string field definitions.
  • Fixed vector distance SQL generation: Invalidate sqlglot's _DISPATCH_CACHE after registering custom TRANSFORMS, so dialect-specific vector distance operators (pgvector <->, MySQL DISTANCE(), Oracle VECTOR_DISTANCE(), etc.) are actually used instead of generic OPERATOR() syntax.
  • Added set_migration_config(): Migration configuration can now be attached after initial config creation via property setter or explicit method.
  • Moved to TypedDicts for config: Connection configs now use TypedDicts for better type safety and IDE support.
  • Psycopg type safety: Added shims for type aliases in _typing.py to resolve pyright errors.
  • Path resolution fix: Corrected SQLFileLoader to handle alias-relative paths and identical path/base_path cases.
  • Updated dependencies: Corrected import paths in asyncmy and postgres dialects.

Closes

@cofin cofin changed the title fix: resolve mypyc compilation bugs and runtime segfaults fix: resolve mypyc compilation bugs, exception handling, filter providers, and vector distance SQL generation Apr 6, 2026
@cofin cofin merged commit 36f5092 into main Apr 6, 2026
16 checks passed
@cofin cofin deleted the fix/bugs-n-stuff branch April 6, 2026 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant