Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

FEAT-#6913: support sqlalchemy connectables in read_sql by getting connection url #6956

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

tochigiv
Copy link
Contributor

What do these changes do?

As outlined in the issue, these changes allow passing SQLAlchemy connection objects to read_sql by using the same workaround that is used for to_sql.

  • first commit message and PR title follow format outlined here

    NOTE: If you edit the PR title to match this format, you need to add another commit (even if it's empty) or amend your last commit for the CI job that checks the PR title to pick up the new PR title.

  • passes flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
  • passes black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
  • signed commit with git commit -s
  • Resolves FEAT: Support sqlalchemy connections in read_sql by converting them to strings #6913
  • tests added and passing
  • module layout described at docs/development/architecture.rst is up-to-date

@anmyachev
Copy link
Collaborator

@tochigiv thanks for the contribution! Could you also add a test?

@tochigiv
Copy link
Contributor Author

@tochigiv thanks for the contribution! Could you also add a test?

Is it not already covered by a test?

# Test SQLAlchemy engine
sqlalchemy_engine = sa.create_engine(conn)
eval_io(
fn_name="read_sql",
# read_sql kwargs
sql=query,
con=sqlalchemy_engine,
)
# Test SQLAlchemy Connection
sqlalchemy_connection = sqlalchemy_engine.connect()
eval_io(
fn_name="read_sql",
# read_sql kwargs
sql=query,
con=sqlalchemy_connection,
)

@anmyachev
Copy link
Collaborator

@tochigiv thanks for the contribution! Could you also add a test?

Is it not already covered by a test?

# Test SQLAlchemy engine
sqlalchemy_engine = sa.create_engine(conn)
eval_io(
fn_name="read_sql",
# read_sql kwargs
sql=query,
con=sqlalchemy_engine,
)
# Test SQLAlchemy Connection
sqlalchemy_connection = sqlalchemy_engine.connect()
eval_io(
fn_name="read_sql",
# read_sql kwargs
sql=query,
con=sqlalchemy_connection,
)

Hm, looks like that.

@anmyachev anmyachev merged commit ca42a19 into modin-project:master Feb 22, 2024
37 checks passed
tochigiv added a commit to tochigiv/modin that referenced this pull request Feb 22, 2024
…` by getting connection url (modin-project#6956)

Signed-off-by: Bailey Brownie <bailey.brownie60@gmail.com>
tochigiv added a commit to tochigiv/modin that referenced this pull request Feb 22, 2024
…` by getting connection url (modin-project#6956)

Signed-off-by: Bailey Brownie <bailey.brownie60@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FEAT: Support sqlalchemy connections in read_sql by converting them to strings
2 participants