arcgis-python-api icon indicating copy to clipboard operation
arcgis-python-api copied to clipboard

InsecureRequestWarning

Open FeralCatColonist opened this issue 1 year ago • 5 comments
trafficstars

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):

  • OS: Windows 11
  • IDE: VS Code
  • Also tested in Jupyter Notebook that ships with the Esri Anaconda distribution
  • Python API Version 2.4.0

FeralCatColonist avatar Nov 18 '24 21:11 FeralCatColonist