Esri / Esri/arcgis-python-api

No way to set a timeout on FeatureLayer.query()

Open
#2,471 11 comments 0 reactions 0 assignees View on GitHub
As-Designed
Dominant language
Python
Stars
2.2k
Forks
1.2k
Avg merge
2h 40m
Merged PRs (30d)
2

Description

**Describe the bug**
When calling FeatureLayer.query() with a timeout parameter, the value is accepted without error but has no effect on the underlying HTTP request. Large layers can hang indefinitely as a result.

Root cause: FeatureLayer.query() accepts **kwargs and passes them to internal methods, but the timeout kwarg is never forwarded to the underlying requests.Session call.

**To Reproduce**
Steps to reproduce the behavior:
```python
from arcgis.features import FeatureLayer
layer = FeatureLayer("https://example.com/arcgis/rest/services/.../FeatureServer/0")
# timeout is silently ignored — the request can hang indefinitely
features = layer.query(where="1=1", out_fields="*", return_geometry=True, timeout=10)
```

**Expected behavior**
The HTTP request should time out after 10 seconds.

**Actual behavior**
The request never times out regardless of the timeout value.

**Platform (please complete the following information):**
- Python API Version [`2.4.1`] (but I also saw that it is not fixed in 2.4.2 as well)`

**Additional context**
Add any other context about the problem here, attachments etc.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.