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

Unhandled SDKError looker_sdk.error.SDKError: <exception str() failed> #1454

Open
bobwilkinson20 opened this issue Apr 12, 2024 · 4 comments
Labels
bug Regression or bug p3 Priority 3 python Python SDK issues

Comments

@bobwilkinson20
Copy link

Fresh install including a downgraded cattrs per the known issue with it.
attrs==23.2.0
cattrs==23.1.2
certifi==2024.2.2
charset-normalizer==3.3.2
idna==3.7
looker-sdk==24.4.0
requests==2.31.0
typing_extensions==4.11.0
urllib3==2.2.1

Attempting to run example https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/simple_schedule_plan.py

Results in:

Traceback (most recent call last):
  File ".../schedule_updater.py", line 55, in <module>
    create_simple_schedule('1336',sdk.me().id,"This is an automated test", "assembled_pdf", "[email protected]", "email", "Hi Looker User!", "0 1 * * *")
  File ".../schedule_updater.py", line 51, in create_simple_schedule2
    schedule = sdk.create_scheduled_plan(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/lib/python3.12/site-packages/looker_sdk/sdk/api40/methods.py", line 10699, in create_scheduled_plan
    self.post(
  File ".../.pyenv/versions/3.12.2/lib/python3.12/site-packages/looker_sdk/rtl/api_methods.py", line 188, in post
    return self._return(response, structure)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/lib/python3.12/site-packages/looker_sdk/rtl/api_methods.py", line 101, in _return
    raise sdk_error
looker_sdk.error.SDKError: <exception str() failed>
@github-actions github-actions bot added p3 Priority 3 need triage labels Apr 12, 2024
@nathan-michel-devoteam
Copy link

I have got quite the same problem here when calling function sdk.create_group with Python sdk (but it works for other functions). In fact it creates the group as expected but still triggers this weird error
I have also looker-sdk version 24.4.0 and my looker instance is on 24.4.28 (Looker original)

@kiran2706
Copy link

kiran2706 commented May 16, 2024

I've fixed this issue, but I can't create a new branch in this repo. Can somebody please help me fix the permission issue and assist me in making my first contribution? Thank you.

cc: @jkaster @joeldodge79 @josephaxisa

@jlieow
Copy link

jlieow commented Jun 4, 2024

Fresh install including a downgraded cattrs per the known issue with it. attrs==23.2.0 cattrs==23.1.2 certifi==2024.2.2 charset-normalizer==3.3.2 idna==3.7 looker-sdk==24.4.0 requests==2.31.0 typing_extensions==4.11.0 urllib3==2.2.1

Attempting to run example https://github.com/looker-open-source/sdk-codegen/blob/main/examples/python/simple_schedule_plan.py

Results in:

Traceback (most recent call last):
  File ".../schedule_updater.py", line 55, in <module>
    create_simple_schedule('1336',sdk.me().id,"This is an automated test", "assembled_pdf", "[email protected]", "email", "Hi Looker User!", "0 1 * * *")
  File ".../schedule_updater.py", line 51, in create_simple_schedule2
    schedule = sdk.create_scheduled_plan(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/lib/python3.12/site-packages/looker_sdk/sdk/api40/methods.py", line 10699, in create_scheduled_plan
    self.post(
  File ".../.pyenv/versions/3.12.2/lib/python3.12/site-packages/looker_sdk/rtl/api_methods.py", line 188, in post
    return self._return(response, structure)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../.pyenv/versions/3.12.2/lib/python3.12/site-packages/looker_sdk/rtl/api_methods.py", line 101, in _return
    raise sdk_error
looker_sdk.error.SDKError: <exception str() failed>

Error originates from the object models40.ScheduledPlanDestination() and can be replaced with a json equivalent:

{
  "format": format,
  "apply_formatting": True,
  "apply_vis": True,
  "address": email,
  "type": type,
  "message": message,
}

@jeremytchang jeremytchang added bug Regression or bug python Python SDK issues and removed need triage labels Aug 26, 2024
@jeremytchang
Copy link
Collaborator

Thanks for reporting this!

We welcome and encourage all contributions! However for testing/security reasons, we don't give write privileges to developers outside of google. @kiran2706 Can you setup a fork and a PR with your changes? We'll setup a PR in this repo with your commit (so you can have contribution). Thanks in advance!

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

No branches or pull requests

5 participants