-
Notifications
You must be signed in to change notification settings - Fork 118
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
SNOW-1348700 Fix to_char's implementation when incoming column has inconsecutive row index #1702
Conversation
f539181
to
6cb0faa
Compare
CHANGELOG.md
Outdated
## 1.18.1 (TBD) | ||
|
||
### Snowpark Python API Updates | ||
|
||
#### New Features | ||
|
||
#### Improvements | ||
|
||
### Snowpark pandas API Updates | ||
|
||
#### New Features | ||
|
||
#### Improvements | ||
|
||
#### Bug Fixes | ||
|
||
### Snowpark Local Testing Updates | ||
|
||
#### Breaking changes | ||
|
||
### New Features | ||
|
||
#### Bug Fixes | ||
|
||
- Fixed a bug in mock implementation of `to_char` that raises `IndexError` when incoming column has inconsecutive row index. | ||
|
||
#### Improvements | ||
|
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.
nit: there is a 1.19.0 section now
@@ -1027,7 +1025,7 @@ def convert_char(row): | |||
) | |||
|
|||
# row index information is needed to retrieve format information in another pd series, thus calling to_frame here | |||
res = column.to_frame().apply(convert_char, axis=1) | |||
res = column.combine(fmt, convert_char) |
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.
_to_timestamp implementation also uses column.to_frame()
, should we fix that as well?
I'm good with either fixing in this PR or having another PR.
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.
I have created #1740.
6cb0faa
to
1cbcce9
Compare
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-1348700
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Previously the implementation of mock_to_char relies on the incoming column has index of [0,1,...,n-1], this is not always true and causes the code raise
IndexError
, this PR fixes that and adds a test for this specific scenario.