Esri / arcgis-python-api

Documentation and samples for ArcGIS API for Python
https://developers.arcgis.com/python/
Apache License 2.0
1.9k stars 1.11k forks source link

InsecureRequestWarning #2164

Open FeralCatColonist opened 11 hours ago

FeralCatColonist commented 11 hours ago

Describe the bug When using the ArcGIS API from the Esri Anaconda repository, fetching a content search, the urllib3 warning appears when search parameter max_items>200 or max_items=-1; this is not reproducible when using the arcgis library shipped with ArcGIS Pro 3.4.0

To Reproduce Steps to reproduce the behavior:

# MINIMUM EXAMPLE
import arcgis

gis = arcgis.gis.GIS("pro")
content_list = gis.content.search(query="*", max_items=201)
print(f"\nat ArcGIS API for Python version {arcgis.__version__}\ncontent.search triggers, additional API calls trigger same warning\n")
content_list[0].get_data()

error:

c:\Users\feralcatcolonist\AppData\Local\miniforge3\envs\esri\Lib\site-packages\urllib3\connectionpool.py:1099: InsecureRequestWarning: Unverified HTTPS request is being made to host 'www.arcgis.com'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#tls-warnings
  warnings.warn(

Screenshots working in ArcGIS Pro image not working in standalone environment from Esri's Anaconda channel when search greater than 200 image working in standalone environment from Esri's Anaconda channel when search is equal to or less than 200 image same results in Jupyter Notebook image

Expected behavior At the previous version 2.3.x this issue did not surface; I would not expect to see insecure requests happening when utilizing the "pro" method of authentication.

Platform (please complete the following information):

nanaeaubry commented 2 hours ago

@FeralCatColonist Thank we are working on this. It has to do with us making the API a bit more robust.