Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python SDKError __str__ bug #1479

Closed
syvokobylka opened this issue Jul 4, 2024 · 1 comment · Fixed by #1480
Closed

python SDKError __str__ bug #1479

syvokobylka opened this issue Jul 4, 2024 · 1 comment · Fixed by #1480
Labels
bug Regression or bug p3 Priority 3 python Python SDK issues

Comments

@syvokobylka
Copy link
Contributor

syvokobylka commented Jul 4, 2024

Attempt to represent python SDKError object as a string leads to another exception happening

.....
except looker_sdk.error.SDKError as ex:
    logger.error(f"Some important data and {str(ex)}")

Call stack:
2024-07-04 11:35:58.130
TypeError: sequence item 0: expected str instance, ErrorDetail found
2024-07-04 11:35:58.130
{sep.join(self.errors)}
2024-07-04 11:35:58.130
File "/root/.pyenv/versions/3.10.5/lib/python3.10/site-packages/looker_sdk/error.py", line 85, in str

@github-actions github-actions bot added need triage p3 Priority 3 labels Jul 4, 2024
drstrangelooker pushed a commit that referenced this issue Jul 29, 2024
Fix for the issue: attempt to represent python SDKError object as a
string leads to TypeError exception ahppening, since python join()
doesn't convert ErrorDetail object to string automatically.

## Developer Checklist
[ℹ️](https://github.com/looker-open-source/sdk-codegen/blob/main/CONTRIBUTING.md#developer-checklist)

Thank you for opening a Pull Request! Before submitting your PR, there
are a few things you can do to make sure it goes smoothly:

- [x] Make sure to open an issue as a
[bug/issue](https://github.com/looker-open-source/sdk-codegen/issues/new/choose)
before writing your code! That way we can discuss the change, evaluate
designs, and agree on the general idea
- [ ] Ensure the tests and linter pass
- [ ] Appropriate docs were updated (if necessary)

Fixes #1479 🦕
@jeremytchang
Copy link
Collaborator

Closing as fixed. #1486

@jeremytchang jeremytchang added python Python SDK issues bug Regression or bug and removed need triage labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Regression or bug p3 Priority 3 python Python SDK issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants