Skip to content

Enhance SQLServerColumn to support fixed numeric types and update tests#14

Merged
axellpadilla merged 1 commit intopatchedfrom
patch/sqlserver-column-n-type-expansion
Sep 30, 2025
Merged

Enhance SQLServerColumn to support fixed numeric types and update tests#14
axellpadilla merged 1 commit intopatchedfrom
patch/sqlserver-column-n-type-expansion

Conversation

@axellpadilla
Copy link
Copy Markdown
Owner

This pull request enhances type handling and expansion logic for SQL Server columns, particularly around money-related types. The main changes include introducing a dedicated method for fixed-money types, refining numeric type checks, and updating the logic for type expansion to handle money and smallmoney types more accurately. The test suite is also expanded to cover these new scenarios.

Type handling improvements:

  • Added a new method is_fixed_numeric to sqlserver_column.py to distinguish fixed-money types (money, smallmoney) from other numeric types.
  • Updated is_number to include fixed-money types in its check, improving overall numeric type detection.
  • Refined is_numeric to only match numeric and decimal, separating out money types for clearer logic.

Type expansion logic:

  • Modified the can_expand_to method to allow expansion between numeric and fixed-money types, and to consider dtype changes as expansions when precision/scale are equal.

Test coverage:

  • Added multiple new test cases to test_can_expand_to.py to verify correct behavior for money, smallmoney, and numeric type expansions, including scenarios with and without feature flags.

@axellpadilla axellpadilla merged commit f9a0d0c into patched Sep 30, 2025
0 of 9 checks passed
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

Successfully merging this pull request may close these issues.

1 participant