Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement support for SQLAlchemy 2.0 #184

Open
Vitor-Avila opened this issue Jan 27, 2023 · 4 comments
Open

Implement support for SQLAlchemy 2.0 #184

Vitor-Avila opened this issue Jan 27, 2023 · 4 comments

Comments

@Vitor-Avila
Copy link
Contributor

SQLAlchemy 2.0 was recently released. When using this version, the CLI throws an error when trying to sync a BQ DB from DBT.

@Vitor-Avila
Copy link
Contributor Author

This code (and other uses of the sqlalchemy.URL class), doesn't work with the new SQLAlchemy version since it defaults to hide_password: bool = True (reference).

We might need to include .render_as_string(hide_password = False):

return {
        "sqlalchemy_uri": str(
            URL(
                drivername="postgresql+psycopg2",
                username=username,
                password=password,
                host=host,
                port=port,
                database=dbname,
                query=query,
            ).render_as_string(hide_password = False),
        ),
    }

@josescuderoh
Copy link

I'm also having issues integrating preset-cli to our dbt project. For context, we use Meltano to manage ETL jobs it requires sqlalchemy (>=2.0.31,<3.0.0).

Because no versions of preset-cli match >0.2.20,<0.3.0
 and preset-cli (0.2.20) depends on sqlalchemy (>=1.4,<2), preset-cli (>=0.2.20,<0.3.0) requires sqlalchemy (>=1.4,<2).
And because meltano (3.5.0) depends on sqlalchemy (>=2.0.31,<3.0.0), preset-cli (>=0.2.20,<0.3.0) is incompatible with meltano (3.5.0).
So, because your project depends on both meltano (3.5.0) and preset-cli (~0.2.20), version solving failed.

Any ideas if and when this upgrade will be done?

@Vitor-Avila
Copy link
Contributor Author

Hey @josescuderoh,

I know this is currently not being worked by the Preset team. There has been ongoing discussions to implement support for SQLAlchemy 2.0 on Superset, which would definitely help making a case for also implementing compatibility in the CLI.

We also have a CLA in place to accept external contributions in case you would be interested.

Thanks!

@josescuderoh
Copy link

Thanks for the prompt answer @Vitor-Avila - It's good we know what to expect.
We've decided to work around it by running the preset-cli using a different image for now.
Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants