Skip to content

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

@sgiacomel

Description

@sgiacomel

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions