Skip to content

Fix AttributeError: align field access with erspec snake_case convention#9

Draft
Copilot wants to merge 3 commits intofeature/ERE1-123from
copilot/sub-pr-4-another-one
Draft

Fix AttributeError: align field access with erspec snake_case convention#9
Copilot wants to merge 3 commits intofeature/ERE1-123from
copilot/sub-pr-4-another-one

Conversation

Copy link

Copilot AI commented Feb 26, 2026

Code was accessing erspec model fields using camelCase (ereRequestId, errorTitle) but LinkML generates snake_case attributes (ere_request_id, error_title), causing runtime AttributeError.

Changes

  • Services layer (redis.py, __init__.py): Updated all log statements accessing request.ereRequestIdrequest.ere_request_id
  • Adapters layer (redis.py, mock_resolver.py): Fixed field access in logging and EREErrorResponse construction

Example

# Before (runtime error)
log.debug(f"Request id: {request.ereRequestId}")
return EREErrorResponse(ereRequestId=id, errorTitle="...", errorType="...")

# After (correct)
log.debug(f"Request id: {request.ere_request_id}")
return EREErrorResponse(ere_request_id=id, error_title="...", error_type="...")

All erspec model field access now matches LinkML schema definitions.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 26, 2026 08:11
…RequestId

Co-authored-by: gkostkowski <12532923+gkostkowski@users.noreply.github.com>
…ke_case

Co-authored-by: gkostkowski <12532923+gkostkowski@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Docker-based infrastructure for local ERE development Fix AttributeError: align field access with erspec snake_case convention Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants