Skip to content

add ansi-safe casting#303

Merged
yankomo merged 9 commits intomainfrom
ansi-safe-cast
Apr 8, 2026
Merged

add ansi-safe casting#303
yankomo merged 9 commits intomainfrom
ansi-safe-cast

Conversation

@yankomo
Copy link
Copy Markdown
Contributor

@yankomo yankomo commented Mar 27, 2026

Description

When using Databricks serverless compute, ANSI mode is on by default, which enforces stricter standards on some SQL commands, one of which is stricter casting behavior.

This PR

  • updates Spark Expectations internal code to use a cast function that is safe for ANSI mode usage
  • updates documentation to guide the user to provide ANSI-compliant expectations if they use serverless
  • updates error messages to be more informative when these errors are encountered

Related Issue

#304

Motivation and Context

See above. Enables casting in Spark Expectations to be ANSI-compliant.

How Has This Been Tested?

Added new unit tests & ran

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.57%. Comparing base (22d5ef8) to head (0acdd5f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #303      +/-   ##
==========================================
+ Coverage   98.56%   98.57%   +0.01%     
==========================================
  Files          32       32              
  Lines        3547     3579      +32     
==========================================
+ Hits         3496     3528      +32     
  Misses         51       51              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@yankomo yankomo linked an issue Apr 6, 2026 that may be closed by this pull request
@yankomo yankomo marked this pull request as ready for review April 6, 2026 23:07
@yankomo yankomo requested a review from a team as a code owner April 6, 2026 23:07
@asingamaneni
Copy link
Copy Markdown
Collaborator

cursor_pull_request_303_review.md

Please look at the issues pointed and fix them

@smirkovic smirkovic requested a review from a team April 7, 2026 17:38
@yankomo
Copy link
Copy Markdown
Contributor Author

yankomo commented Apr 7, 2026

cursor_pull_request_303_review.md

Please look at the issues pointed and fix them

Thanks for this review, Ashok! I looked over the feedback and I think that it can all be added to a follow-up improvement ticket. Although some of the callouts are described as bugs I'd argue that nothing is actually broken with the code the PR introduces, just perhaps not as pretty or clear as it could be. But please let me know if there are specific points in your feedback that you'd say absolutely need to be addressed for this PR and could not be added as a follow-up.

Copy link
Copy Markdown
Contributor

@AmaniG77 AmaniG77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yankomo
Copy link
Copy Markdown
Contributor Author

yankomo commented Apr 7, 2026

cursor_pull_request_303_review.md

Please look at the issues pointed and fix them

I made a new issue to track this! #306

@yankomo yankomo merged commit 44a6b54 into main Apr 8, 2026
6 checks passed
@yankomo yankomo deleted the ansi-safe-cast branch April 8, 2026 16:26
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.

[FEATURE] Support ANSI Mode for CAST Commands

5 participants