PNDSPY1017¶
Message pandas.core.reshape.encoding.get_dummies has a partial mapping because there is a not supported scenario in Snowpark pandas.
Category Warning
Description¶
This issue appears when the SMA identifies a pandas.core.reshape.encoding.get_dummies usage.
Snowpark pandas currently has limitations with pandas.get_dummies. It’s supported if parameters “dummy_na” and “drop_first” are both false; otherwise it isn’t supported.
Scenario¶
An unsupported use of pandas.core.reshape.encoding.get_dummies.
Input¶
The following example shows an unsupported use of pandas.core.reshape.encoding.get_dummies.
Output¶
The SMA adds the EWI PNDSPY1017 to the output code to indicate that it has a scenario not supported in Snowpark pandas.
Recommended fix¶
For the dummy_na parameter¶
This requires a manual adjustment:
Replace the
np.nanvalue with an acceptable value such as'np.nan'.Remove the use of the parameter
dummy_na.Rename the column
'np.nan'to the originalnp.nanvalue.
To illustrate the recommended fix, here is the output code with the changes applied:
For the drop_first parameter¶
This requires a manual adjustment:
Remove the use of the parameter
drop_first.Remove the first column of the result (you can use the
ilocindexer for it).
To illustrate the recommended fix, here is the output code with the changes applied: