Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions Adyen/services/dataProtection/data_protection_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"""
Submit a Subject Erasure Request.
"""
endpoint = self.baseUrl + "/requestSubjectErasure"
endpoint = self.baseUrl + f"/requestSubjectErasure"

Check warning on line 20 in Adyen/services/dataProtection/data_protection_api.py

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Add replacement fields or use a normal string instead of an f-string.

See more on https://sonarcloud.io/project/issues?id=Adyen_adyen-python-api-library&issues=AZ0K0xdy63pryTICbPb4&open=AZ0K0xdy63pryTICbPb4&pullRequest=446
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The use of an f-string for "/requestSubjectErasure" is redundant as it contains no expressions to interpolate. To properly leverage f-strings for string concatenation and improve readability, you should format the entire endpoint string as a single f-string.

Suggested change
endpoint = self.baseUrl + f"/requestSubjectErasure"
endpoint = f'{self.baseUrl}/requestSubjectErasure'

method = "POST"
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This line is 100 characters long, which exceeds the common recommendation of 79 or 88 characters from style guides like PEP 8, making it harder to read. The previous multi-line format was more readable and compliant with standard line length limits.

Suggested change
return self.client.call_adyen_api(request, self.service, method, endpoint, idempotency_key, **kwargs)
return self.client.call_adyen_api(
request, self.service, method, endpoint, idempotency_key, **kwargs
)


Loading