dbt-labs / dbt-athena

The athena adapter plugin for dbt (https://getdbt.com)
https://dbt-athena.github.io
Apache License 2.0
228 stars 100 forks source link

[Bug] No module named 'tenacity.asyncio' when running dbt-athena #671

Closed t04glovern closed 4 months ago

t04glovern commented 5 months ago

Is this a new bug in dbt-athena?

Current Behavior

08:05:33  Running with dbt=1.7.11
08:05:33  Encountered an error:
No module named 'tenacity.asyncio'
08:05:33  Traceback (most recent call last):
...
...
...
  File "/home/runner/.local/lib/python3.10/site-packages/dbt/adapters/athena/__init__.py", line 2, in <module>
    from dbt.adapters.athena.connections import AthenaConnectionManager, AthenaCredentials
  File "/home/runner/.local/lib/python3.10/site-packages/dbt/adapters/athena/connections.py", line 12, in <module>
    import tenacity
  File "/home/runner/.local/lib/python3.10/site-packages/tenacity/__init__.py", line 653, in <module>
    from tenacity.asyncio import AsyncRetrying  # noqa:E402,I100
ModuleNotFoundError: No module named 'tenacity.asyncio'

The issue is due to a breaking change in https://github.com/jd/tenacity/issues/471, which is automatically installed due to the dependency on tenacity~=8.2 - which equates to tenacity>=8.*

Hopefully this problem will be resolved with a release of version 8.5 which will automatically be used by this repository https://github.com/dbt-athena/dbt-athena/blob/main/setup.py#L62

Expected Behavior

Queries should run - this is not a bug with dbt-athena specifically, though, so nothing should tangably change with this library.

Steps To Reproduce

  1. Install dbt-athena (any version where the tenacity~=8.2 is defined in the setup.py)
  2. Run any dbt job

Environment

- OS: Ubuntu 22.04
- Python: 3.10
- dbt: 1.7.11
- dbt-athena-community: 1.7.2

Additional Context

No response

nicor88 commented 5 months ago

@t04glovern looks like that the fix is simple as installing forcing the installation of "tenacity~=8.3" here https://github.com/dbt-athena/dbt-athena/blob/main/setup.py#L62. Feel free to propose a fix for it, otherwise I will take care of it in the next days.

Also, as you might have done already, you can force the installation of "tenacity~=8.3" in your python env, and that should fix the issue as well as a workaround.

CommonCrisis commented 5 months ago

This is fixed with 8.4.1: https://github.com/jd/tenacity/issues/475#issuecomment-2173259665

CommonCrisis commented 4 months ago

Pretty sure this can be closed