-
Notifications
You must be signed in to change notification settings - Fork 594
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
refactor(padding): follow python string padding conventions #10096
Conversation
This _attempts_ to unify several backends string padding behavior to follow the Python semantics for padding instead of the SQL semantics. That is, if you pad a string to some length N and `len(string) > N` just leave the string untouched (SQL will trim the string to length N).
Oh, and while our padding was all over the place across various backends, I suppose this is a breaking change? I can adjust the commit message. |
For trino and oracle (and other backends that implement the SQL lpad/rpad), what about something like Or |
that's a good idea! |
I actually decided to use this as the base implementation since it's easier to read (both in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Thank you!
…ject#10096) BREAKING CHANGE: String padding operations now follow Python semantics and leave strings greater than the padding length untouched.
Description of changes
This PR updates all backends to perform string padding in the same way that Python does, instead of the way that SQL does.
Python:
SQL:
In short, if the padding candidate is longer than the padding length, just leave
it alone.
BREAKING CHANGE: String padding operations now follow Python semantics and leave strings greater than the padding length untouched.