criteo / criteo-api-python-sdk

4 stars 3 forks source link

Issue with the latest criteo api python sdk (ver. 2023.01) #14

Closed ilov3 closed 1 year ago

ilov3 commented 1 year ago

After updating to criteo-api-retailmedia-sdk-2023.1.0.230216 I've got following error message while initializing CampaignApi class:

Traceback (most recent call last):
  File "/Users/admin/.pyenv-x86/versions/3.7.13/lib/python3.7/concurrent/futures/_base.py", line 428, in result
    return self.__get_result()
  File "/Users/admin/.pyenv-x86/versions/3.7.13/lib/python3.7/concurrent/futures/_base.py", line 384, in __get_result
    raise self._exception
  File "/Users/admin/.local/share/virtualenvs/airflow_dags2-APO5MsMG/lib/python3.7/site-packages/tenacity/__init__.py", line 420, in __call__
    result = fn(*args, **kwargs)
  File "/Users/admin/dev/provectus/pepsi/airflow_dags2/dags/aws_dags/criteo/hooks/criteo_api_client_hook.py", line 90, in get_accounts
    return CampaignApi(api_client=self.api_client).get_api_v1_external_accounts(page_index=page_index)
  File "/Users/admin/.local/share/virtualenvs/airflow_dags2-APO5MsMG/lib/python3.7/site-packages/criteo_api_retailmedia_v2023_01/api/campaign_api.py", line 184, in __init__
    (file,),
NameError: name 'file' is not defined

Seems like an issue in this line - https://github.com/criteo/criteo-api-python-sdk/blob/main/sdks/retailmedia_2023-01/criteo_api_retailmedia_v2023_01/api/campaign_api.py#L184 I can't find where is the file name got defined, and the file is not a python builtin keyword nor builtin type.

PS: Tried to rollback to the prev version criteo-api-retailmedia-sdk-2022.10.0.230216 but seems like its code got updated with the new release and has now the same issue with that line. Hope that this got resolved soon

iamishan9 commented 1 year ago

Hey @ilov3, Thank you for raising this issue. We will work on resolving this soon.