SNOW-2044877: fix snowpandas in apply error msg#3678
Conversation
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
| "pandas on Snowflake cannot be referenced within the pandas on Snowflake apply() function" | ||
| ), | ||
| ): | ||
| df.apply(lambda row: pd.to_datetime(f"{row.date} {row.time}"), axis=1) |
There was a problem hiding this comment.
I think what is confusing about these is that the pd. reference is modin.pandas not pandas. We may want to explicitly say that and mention that or illustrate with an example
import modin.pandas as pd
df.apply(lambda row: pd.to_datetime(f"{row.date} {row.time}"), axis=1)
import modin.pandas as pd
#...do stuff
import pandas
df.apply(lambda row: pandas.to_datetime(f"{row.date} {row.time}"), axis=1)
There was a problem hiding this comment.
That makes sense I can add the import in the test itself to make it more clear. The example of apply with native pandas will go in the docs though right? There are already tests with df.apply(native_pd)
| e | ||
| ) or "Modin is not installed" in str(e): | ||
| raise SnowparkSQLException( | ||
| "pandas on Snowflake cannot be referenced within the pandas on Snowflake apply() function. " |
There was a problem hiding this comment.
See comment below on more specific recommendations for how to fix this. We may want to add a stub in the documentation with an example and link to the docs from the error message.
There was a problem hiding this comment.
Do you mean we should create a new section under Limitations that can be linked from this error message?
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
| e | ||
| ) or "Modin is not installed" in str(e): | ||
| raise SnowparkSQLException( | ||
| "pandas on Snowflake cannot be referenced within the pandas on Snowflake apply() function. " |
There was a problem hiding this comment.
Referring to "pandas on Snowflake" is also confusing here. I know it's our "official" name for the Snowpark pandas product, but users are likely to interpret it as just referring to pandas in general.
IMO it's better to make it more explicit that it's referring to modin, e.g. "modin.pandas cannot be referenced within a Snowpark pandas apply() function".
There was a problem hiding this comment.
That's true, I followed the statement in the docs but this sounds clearer for this context
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Signed-off-by: Labanya Mukhopadhyay <labanya.mukhopadhyay@snowflake.com>
Which Jira issue is this PR addressing? Make sure that there is an accompanying issue to your PR.
Fixes SNOW-2044877
Fill out the following pre-review checklist:
Please describe how your code solves the related issue.
Updating Snowpark pandas in apply error message to a more relevant one