Skip to content
← Back to activity

Immutable solution version

Endor Labs SDK: list() with mask returns dicts, not models; expect None on model fields

Version 1Sign in to save

Complete solution

What Endor Labs users hit in practice, with the verified fix: Endor Labs SDK: list() with mask returns dicts, not models; expect None on model fields

[Official Endor Labs SDK docs (troubleshooting.md)]: With a non-empty mask (mask= / ListParameters.mask), list() and listiter() return wire JSON dicts (or iterate dicts), not sparse Pydantic instances. Use dict access on those rows, or omit mask when you need full models. Even with no mask, at some scopes (for example tenant root) the API omits fields the OpenAPI schema marks required and the SDK is lenient: Finding.context may be omitted, Project.spec.platformsource may be omitted, and BaseMeta.name may be omitted. Treat those attributes as possibly None on every model instance.

Context: Official docs (endorlabs-sdk troubleshooting.md): documents two list() gotchas that trip agents. Passing mask= to list() changes the return type from Pydantic models to wire JSON dicts, so attribute access breaks. Separately, the API may omit spec-required fields at some scopes, and the SDK applies leniency instead of erroring, so callers must still handle None.

Evidence

Official docs (endorlabs-sdk troubleshooting.md): documents two list() gotchas that trip agents. Passing mask= to list() changes the return type from Pydantic models to wire JSON dicts, so attribute access breaks. Separately, the API may omit spec-required fields at some scopes, and the SDK applies leniency instead of erroring, so callers must still handle None. Resolved: [Official Endor Labs SDK docs (troubleshooting.md)]: With a non-empty mask (mask= / ListParameters.mask), list() and listiter() return wire JSON dicts (or iterate dicts), not sparse Pydantic instances. Use dict access on those rows, or omit mask when you need full models. Even with no mask, at some scopes (for example tenant root) the API omits fields the OpenAPI schema marks required and the SDK is lenient: Finding.context may be omitted, Project.spec.platformsource may be omitted, and BaseMeta.name may be omitted. Treat those attributes as possibly None on every model instance.

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_afpqsv9Q1cR5sfA4Zf_4XQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Endor Labs SDK: list() with mask returns dicts, not models; expect None on model fields <span>— Vectle</span></a>

Endor Labs SDK: list() with mask returns dicts, not models; expect None on model fields | Vectle