Skip to content

Fix error types for asset reports#145

Merged
dsfish merged 10 commits intomasterfrom
df-fix
Feb 14, 2019
Merged

Fix error types for asset reports#145
dsfish merged 10 commits intomasterfrom
df-fix

Conversation

@dsfish
Copy link
Copy Markdown
Contributor

@dsfish dsfish commented Feb 11, 2019

No description provided.

@dsfish dsfish requested a review from joyzheng February 11, 2019 22:37
Comment thread plaid/errors.py Outdated
code,
display_message,
request_id="",
causes=[],
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.

I think in general in python you want to avoid passing in {} or [] as a default argument. Because otherwise all callers of this function will default to the same instance, and if it's ever mutated bad things happen in the future.

Copy link
Copy Markdown
Contributor

@mattiskan mattiskan Feb 11, 2019

Choose a reason for hiding this comment

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

Yep, either make it a tuple, or use None and do for cause in (causes or []) below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

⚡️

Comment thread plaid/errors.py Outdated
cause['error_message'],
cause['error_type'],
cause['error_code'],
cause['display_message'] if 'display_message' in cause else '',
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.

cause.get('display_message', '')
?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

⚡️

Comment thread plaid/errors.py Outdated
cause['error_code'],
cause['display_message'] if 'display_message' in cause else '',
)
self.causes.append(c)
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.

nit: can we make this a list-comprehension?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

⚡️

@mattiskan
Copy link
Copy Markdown
Contributor

lg2m

@dsfish dsfish merged commit 279f6ca into master Feb 14, 2019
@dsfish dsfish deleted the df-fix branch February 14, 2019 19:22
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.

3 participants