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
to_featureset() is not handling fields with null date values correctly #1819
Comments
@tbrobin Thanks for reporting this, sorry for the delayed response. I will take a look and see where this new error is coming from. |
@tbrobin Can you provide us with some reproducible data and code? |
Dates.xlsx #path to Dates excel nonulls=pd.read_excel(dates_excel,sheet_name='NoNulls') nonulls_fs=nonulls.spatial.to_featureset() #test feature set with nulls #test feature set without nulls |
Thanks for looking into this! |
@tbrobin Ok I see the issue, Pandas interprets NaN values as float and not int. Hence why the entire column gets changed to float values when null dates are present. |
Great! So will this be fixed in the next ArcGIS API Release? |
@tbrobin yes! |
I am using to_featureset() to create a featureset from a spatially enabled dataframe and then using edit_features() to edit a feature layer on AGOL. I was having this issue #1693 so I rolled back to a previous version of the API. Now that 2.3.0 is out, I was going to try my luck again.
It seems there is a new bug with to_featureset(). Only some of my features manage to successfully make it to the feature layer using edit_features(). And I am getting this message when they fail.
{'addResults': [{'objectId': 1,
'uniqueId': 1,
'globalId': None,
'success': False,
'error': {'code': 1000,
'description': 'The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 21 ("@applicant_closeout_date"): The supplied value is not a valid instance of data type float. Check the source data for invalid values. An example of an invalid value is data of numeric type with scale greater than precision.'}}],
'updateResults': [],
'deleteResults': []}
That field is not a float. It is a date with null values mixed in. I did some troubleshooting and it seems to_featureset() is treating that field differently than other date fields in the data with no nulls.
Here is how it treats that field if I remove the null values, and these values will work in a bulk edit using edit_features(adds=featureset.features).
Here is how it treats that field if it has null values, and it won't work using edit_features(adds=featureset.features).
The text was updated successfully, but these errors were encountered: