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

move_look function error not handled #1476

Open
larrybirb opened this issue Jun 27, 2024 · 1 comment
Open

move_look function error not handled #1476

larrybirb opened this issue Jun 27, 2024 · 1 comment
Labels
enhancement New feature request p3 Priority 3 python Python SDK issues

Comments

@larrybirb
Copy link

‎APIMethods._return‎ is not handling errors from ‎Looker40SDK.move_look function. We see a non-useful exception str() failed when the API fails which obscures debugging.

Traceback (most recent call last):
  File "/home/user/shared-tableau-scripts/gcp-perms/looker_api_move_look_production.py", line 23, in <module>
    response = sdk.move_look(id, folder)
  File "/home/user/.local/lib/python3.10/site-packages/looker_sdk/sdk/api40/methods.py", line 7417, in move_look
    self.patch(
  File "/home/user/.local/lib/python3.10/site-packages/looker_sdk/rtl/api_methods.py", line 210, in patch
    return self._return(response, structure)
  File "/home/user/.local/lib/python3.10/site-packages/looker_sdk/rtl/api_methods.py", line 102, in _return
    raise sdk_error
looker_sdk.error.SDKError: <exception str() failed>

The actual API error:

{"message":"Validation Failed","errors":[{"field":"folder_id","code":"already_exists","message":"folder_id and the folder id of the existing look must be different","documentation_url":"
https://cloud.google.com/looker/docs/r/err/4.0/422/patch/looks/:look_id/move"}],"documentation_url":"https://cloud.google.com/looker/docs/r/err/4.0/422/patch/looks/:look_id/move"}
@github-actions github-actions bot added p3 Priority 3 need triage labels Jun 27, 2024
@jeremytchang jeremytchang added enhancement New feature request javascript Pull requests that update Javascript code python Python SDK issues bug Regression or bug and removed need triage javascript Pull requests that update Javascript code enhancement New feature request labels Aug 26, 2024
@jeremytchang
Copy link
Collaborator

jeremytchang commented Aug 26, 2024

This may be a feature request/enhancement for better error handling in python sdk. We need to investigate.

In the meantime, welcome any contributions or suggestions!

@jeremytchang jeremytchang added need triage enhancement New feature request and removed bug Regression or bug 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
enhancement New feature request p3 Priority 3 python Python SDK issues
Projects
None yet
Development

No branches or pull requests

2 participants