Skip to content

Conversation

alxkm
Copy link
Contributor

@alxkm alxkm commented Oct 19, 2025

Description

This PR enhances test coverage for PostgresMlEmbeddingOptions by adding tests for previously untested methods and documenting important builder behavior.

Changes

  • Added 6 new test cases covering setters, interface methods, and builder behavior
  • Documents that builder reuses the same instance (not creating new ones on each build())
  • Validates edge cases and null handling

Test Coverage Added

  • Setter functionality - Validates setters work directly on options instance
  • Interface compliance - Tests getModel() and getDimensions() return null as designed
  • Builder behavior - Documents that builder returns same instance on multiple build() calls
  • Builder mutation - Shows that modifying builder after build affects previous instances
  • Null handling - Verifies kwargs setter accepts null values

Value

The tests reveal that the builder pattern implementation reuses the same options instance rather than creating new instances on each build() call. This behavior is now explicitly tested and documented, which is important for developers to understand as it differs from typical builder pattern expectations.

Co-authored-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
Signed-off-by: Oleksandr Klymenko <alexanderklmn@gmail.com>
@ilayaperumalg ilayaperumalg added this to the 1.1.0.M4 milestone Oct 20, 2025
@ilayaperumalg
Copy link
Member

@alxkm Thanks for the PR and @sunyuhan1998 Thanks for the review. Rebased and merged as 838801f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants