Skip to content

Potential issue with use of serialize in Looker SDK #30169

Description

@friedmanmax

Apache Airflow Provider(s)

google

Versions of Apache Airflow Providers

apache-airflow-providers-common-sql==1.3.4
apache-airflow-providers-ftp==3.3.1
apache-airflow-providers-google==8.11.0
apache-airflow-providers-http==4.2.0
apache-airflow-providers-imap==3.1.1
apache-airflow-providers-sqlite==3.3.1

Apache Airflow version

2

Operating System

OS X (same issue on AWS)

Deployment

Amazon (AWS) MWAA

Deployment details

No response

What happened

I wrote a mod on top of LookerHook to access the scheduled_plan_run_once endpoint. The result was the following error.

  File "/usr/local/airflow/dags/utils/looker_operators_mod.py", line 125, in execute
    resp = self.hook.run_scheduled_plan_once(
  File "/usr/local/airflow/dags/utils/looker_hook_mod.py", line 136, in run_scheduled_plan_once
    resp = sdk.scheduled_plan_run_once(plan_to_send)
  File "/usr/local/lib/python3.9/site-packages/looker_sdk/sdk/api40/methods.py", line 10273, in scheduled_plan_run_once
    self.post(
  File "/usr/local/lib/python3.9/site-packages/looker_sdk/rtl/api_methods.py", line 171, in post
    serialized = self._get_serialized(body)
  File "/usr/local/lib/python3.9/site-packages/looker_sdk/rtl/api_methods.py", line 156, in _get_serialized
    serialized = self.serialize(api_model=body)  # type: ignore
TypeError: serialize() missing 1 required keyword-only argument: 'converter'

I was able to get past the error by rewriting the get_looker_sdk function in LookerHook to initialize with looker_sdk.init40 instead, which resolved the serialize() issue.

What you think should happen instead

I don't know why the serialization piece is part of the SDK initialization - would love some further context!

How to reproduce

As far as I can tell, any call to sdk.scheduled_plan_run_once() causes this issue. I tried it with a variety of different dict plans. I only resolved it by changing how I initialized the SDK

Anything else

n/a

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions