My code recently started throwing errors, but worked fine until August 24th, 2022. The lines that are erroring are my lines that create pandas spatially enabled dataframes.
agol_df = pd.DataFrame.spatial.from_layer(fLayer)
gdb_df = pd.DataFrame.spatial.from_featureclass(lyrPath)
These lines are simply creating dataframes from my online hosted feature layers (first line of code) and my local feature geodatabase (second line of code).
Its strange to me, because it seems like the dataframe is trying to convert my floats to integers, even though I'm not doing a conversion in these lines. I do have null data present in these layers, but it has never been an issue when creating the dataframe before. I'm additionally puzzled because this code functioned perfectly for months and is suddenly throwing errors.
Any help would be greatly appreciated, thank you!
So, this seems to be present with the current python packages if you have recently updated ArcGIS Pro, which will update your arcpy and arcgis libraries. Somehow they are checking for types and forcing a conversion to int even if there isn't an integer field in your feature layer. I did find a work-around. The layer has a method for sdf of which I wasn't aware.
Instead of: agol_df = pd.DataFrame.spatial.from_layer(fLayer)
Use: agol_df = fLayer.query().sdf
This works for tables, too.