Skip to content

Conversation

akshatsinha0
Copy link

Issue #, if available

N/A - Addresses TODO comment in project codebase

Description of changes

Refactored ConnectorResourceReference from namedtuple to @dataclass(frozen=True) (Python 3.8+)

Description of how you validated changes

Ran connector test suite:267 test cases
Verified no breaking changes to the public API+immutability

Checklist

Examples?

N/A - Internal refactor with no user-facing changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@akshatsinha0 akshatsinha0 requested a review from a team as a code owner October 16, 2025 14:40
class ConnectorResourceReference:
"""Reference to a connector resource with all its identifying properties."""

logical_id: str
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When looking at all places that reference this class, it seems like there's an instance where logical_id would be None:

return ConnectorResourceReference(
logical_id=None,
resource_type=resource_type,
arn=obj.get("Arn"),
role_name=obj.get("RoleName"),
queue_url=obj.get("QueueUrl"),
resource_id=obj.get("ResourceId"),
name=obj.get("Name"),
qualifier=obj.get("Qualifier"),
)

Should this be Optional[str]?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ya ya, because id is not provided in the resource reference

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