Hi,
Exporting a spatially enabled dataframe (SDF) to AGOL using spatial.to_featurelayer with a datetime column strips the time as it creates a shapefile and due to the way shapefiles handle dates. Alternative is to create a str column using strftime or to use the more cumbersome method of creating a csv item and publishing that, completely bypassing the SDF.
Could I suggest:
Code to demonstrate the issue attached as .ypnb.
Best wishes
M.
Solved! Go to Solution.
That's a good shout. I was using AGOL Notebooks, which I kinda assumed had the latest version. Lesson 1, check, don't trust.
AGOL Notebooks is on 1.8.1, and to_featurelayer creates a shapefile. Running a Pro Notebook shows 1.8.3, and to_featurelayer creates a gdb in AGOL, solving this issue.
I will let ESRI support know, as I had raised a job with them first, they did not have the solultion, thanks for the suggestion.
What version of the api are you using?
There was a reported issue with datetime on their site
Issues · Esri/arcgis-python-api (github.com)
But if it doesn't apply, then you should open an Issue on their github site
Issues · Esri/arcgis-python-api (github.com)
That's a good shout. I was using AGOL Notebooks, which I kinda assumed had the latest version. Lesson 1, check, don't trust.
AGOL Notebooks is on 1.8.1, and to_featurelayer creates a shapefile. Running a Pro Notebook shows 1.8.3, and to_featurelayer creates a gdb in AGOL, solving this issue.
I will let ESRI support know, as I had raised a job with them first, they did not have the solultion, thanks for the suggestion.