Skip to content

Correct declared Python support and accept the 'id' field - #184

Open
caglarpir wants to merge 1 commit into
mapillary:mainfrom
caglarpir:fix-metadata-and-id-field
Open

Correct declared Python support and accept the 'id' field#184
caglarpir wants to merge 1 commit into
mapillary:mainfrom
caglarpir:fix-metadata-and-id-field

Conversation

@caglarpir

Copy link
Copy Markdown
Contributor

Two small, independent correctness fixes to declared metadata and field validation.

1. REQUIRES_PYTHON was ">=3.0"

That is not satisfiable. The SDK cannot install on any Python 3.x below 3.10, because shapely>=2.1.0 — a declared runtime requirement — itself requires >=3.10. The constraint comes from the dependency set, not from the code: src/ contains no syntax newer than f-strings (no match, no PEP 604 unions, no walrus).

Verified empirically by installing the built wheel into clean environments and letting pip resolve install_requires:

Python Result
3.9 fails to resolve (mapbox-vector-tile>=2.1.0 needs ≥3.9, shapely>=2.1.0 needs ≥3.10)
3.10 installs, SDK works end to end against the live API
3.12 / 3.13 / 3.14 install and pass the suite

Set to ">=3.10". Classifiers updated to match — 3.5 through 3.9 removed (none of them can install the package), 3.13 and 3.14 added, both verified.

2. id was rejected as a field

fields=["id"] raised InvalidFieldError, because id was absent from every entity field list — even though the Graph API accepts it and every decoded feature carries an id property. Confirmed against the live API:

GET /1933525276802129?fields=id,captured_at
{"id":"1933525276802129","captured_at":1507560881000}

GET /498808147909730?fields=id,object_value
{"id":"498808147909730","object_value":"object--street-light"}

Detections likewise return id. Added to the image, map feature, detection (both variants) and organization lists.

One caveat worth stating: images, map features and detections were each verified against the live API. Organization was not — I could not find an organization ID readable with the public test token. id is universal in the Graph API so it is near-certain to work there too, but I would rather flag it than imply I checked.

Test plan

  • pytest — 17 passed
  • flake8 src/mapillary --select=E9,F63,F7,F82 — 0
  • SDK-generated URLs containing id verified against the live API (shown above)
  • Differential dependency harness (41 probes): the only behavioural change is the intended field-list addition

Two independent metadata/validation fixes.

REQUIRES_PYTHON was ">=3.0", which is not satisfiable: the SDK cannot
run on any Python 3.x below 3.10, because shapely>=2.1.0 (a declared
runtime requirement) itself requires >=3.10. Verified by installing the
built wheel into clean environments: 3.9 fails to resolve, 3.10 installs
and the SDK works end to end against the live API. The SDK's own source
uses no syntax newer than f-strings, so the floor comes from the
dependency set rather than the code. Classifiers updated to match, and
3.13/3.14 added -- both verified working.

'id' was missing from every entity field list, so passing fields=['id']
raised InvalidFieldError even though the Graph API accepts it and every
decoded feature carries an id. Confirmed against the live API for
images, map features and detections:

    GET /1933525276802129?fields=id,captured_at
    {"id":"1933525276802129","captured_at":1507560881000}

Added to the image, map feature, detection (both variants) and
organization field lists.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant