Select to view content in your preferred language

Different hosted feature types when run through notebook and IDE

253
2
Jump to solution
08-19-2024 02:34 PM
Labels (1)
ChrisCowin_dhs
Occasional Contributor

Hello,

Notebooks have some nice features. Maintaining a python environment between users is fantastic, but actually coding in Notebooks is horrible. There is no debug, no breakpoints, no way to visually see the possible variables like in other notebooks. So, I code mostly in PyCharm and then just bring it into a notebook when I know the code will actually work. However, I'm getting different behaviors that are causing changes in the data.

When I put data in a df and then use the .to_featurelayer() function it uploads the data differently based on my environment. When I'm in the IDE it publishes the hosted layer with the data as a GDB and when I run it in Notebooks it publishes the hosted layer as a shapefile. The issue here is that I have a field that is getting deleted in the GDB but not in the shapefile. It doesn't seem like there is a parameter to force it to be a shapefile. Does anyone know how to get around this?

 

E: I was able to use the sanitize column and the missing column came in which is weird because it didnt have symbols and there are longer field names. Would still be nice to understand the difference between the environments and if that is controllable.

1 Solution

Accepted Solutions
NanaeAubry
Esri Contributor

Hello, 

The issue with fgdb not being deleted should be fixed. The reason there is filegeodatabase vs shapefile depends on whether you have arcpy in your environment or not. If you would like for it to be consistent then I would recommend having consistent environments: either use arcpy or use shapely.

View solution in original post

0 Kudos
2 Replies
NanaeAubry
Esri Contributor

Hello, 

The issue with fgdb not being deleted should be fixed. The reason there is filegeodatabase vs shapefile depends on whether you have arcpy in your environment or not. If you would like for it to be consistent then I would recommend having consistent environments: either use arcpy or use shapely.

0 Kudos
ChrisCowin_dhs
Occasional Contributor

Oh ok that makes sense, the notebook environment only has the API for Python, thanks for the reply!

0 Kudos