This error / bug does not occur in version 1.7.0.
To reproduce:
from arcgis.gis import server
from arcgis.features import FeatureLayer
gis = server.Server(serverAdminEndpoint, username=username, password=password, verify_cert=False)
fl = FeatureLayer(restrictedFeatureLayerUrl, gis=gis)
features = fl.query()
The last line generates a JSON Decode error.
I've tried various parameters in the fl.query (e.g., as_df, outFields, returnGeometry, etc. etc.) and nothing seems to work. This code was working as 1.7.0, and when I downgraded by arcgis version to 1.7.0 on the same environment that had been generating the error, the code worked.
Hi @Jay_Gregory ,
I tested the code in 1.8.2 and it's working fine. I can recommend to upgrade to ArcGIS API for Python 1.8.2:
from arcgis.gis import server
from arcgis.features import FeatureLayer
gis = server.Server("server url/hosting/admin", username="username", password="password", verify_cert=False)
fl = FeatureLayer("your_ent_admin_profile", gis=gis)
features = fl.query(where='1=1', out_fields='location, rating',)
features
<FeatureSet> 7 features
features.sdf
Thanks - I've tested with a different service on a different ArcGIS Enterprise and this seems to be being caused by a different issue altogether, perhaps how the Server is setup, since it is not federated with Portal. Testing with a different service worked, but upgrading to 1.8.2 and testing with the original service still gave the same error. Unclear why 1.7.0 doesn't give this error, but will continue digging.
Not a problem, @Jay_Gregory .