sdk-codegen icon indicating copy to clipboard operation
sdk-codegen copied to clipboard

scheduled_plans_for_look returns TypeError in api40

Open dwmintz opened this issue 3 years ago • 1 comments

Using the Python SDK, when I run the code suggested by the API explorer:

response = sdk.scheduled_plans_for_look(look_id=1)

I get the following error:

Traceback (most recent call last):
  File "/Users/me/VSCode/looker-sdk/main.py", line 7, in <module>
    response = sdk.scheduled_plans_for_look(look_id=1)
  File "/Users/me/VSCode/looker-sdk/looker_sdk_venv/lib/python3.7/site-packages/looker_sdk/sdk/api40/methods.py", line 9984, in scheduled_plans_for_look
    look_id = self.encode_path_param(look_id)
  File "/Users/me/VSCode/looker-sdk/looker_sdk_venv/lib/python3.7/site-packages/looker_sdk/rtl/api_methods.py", line 122, in encode_path_param
    if value == urllib.parse.unquote(value):
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/parse.py", line 629, in unquote
    if '%' not in string:
TypeError: argument of type 'int' is not iterable

Running the same request in api31 works fine.

dwmintz avatar Mar 25 '22 16:03 dwmintz

Howdy @dwmintz !

Many "id" types recently changed from int -> str on the Looker API (cc @jeremytchang for link to comms?). In this case, hopefully an IDE (or mypy) would flag your syntax given the typing declaration.

We should probably be more lenient about this case in the python sdk, we can use this issue to track best-effort int -> string "id" conversion in path params. For now, try

response = sdk.scheduled_plans_for_look(look_id="1")

joeldodge79 avatar Mar 28 '22 15:03 joeldodge79