Skip to content

Fix unknown properties returning None instead of raising AttributeError#492

Open
gourabsingha1 wants to merge 2 commits into
Adyen:mainfrom
gourabsingha1:bugfix/unknown-properties-attribute-error
Open

Fix unknown properties returning None instead of raising AttributeError#492
gourabsingha1 wants to merge 2 commits into
Adyen:mainfrom
gourabsingha1:bugfix/unknown-properties-attribute-error

Conversation

@gourabsingha1

Copy link
Copy Markdown

This PR fixes a bug (Issue #397) where accessing non-existent attributes on any subclass of AdyenBase (e.g. adyen.foobar) incorrectly returned None instead of raising an AttributeError, which led to confusing runtime errors such as TypeError: 'NoneType' object is not callable.

@gourabsingha1 gourabsingha1 requested a review from a team as a code owner June 27, 2026 12:42

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates Adyen/services/base.py to raise an AttributeError when an unknown attribute is accessed, and adds corresponding unit tests in test/ClientTest.py. The reviewer suggests resolving parent attributes outside of the assertRaises block in the test to prevent false positives if intermediate attributes are missing.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread test/ClientTest.py Outdated
@sonarqubecloud

Copy link
Copy Markdown

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.

1 participant