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

test: include sqlalchemy 1.4 test in python client testing #14491

Merged
merged 2 commits into from
Jan 13, 2024

Conversation

neverchanje
Copy link
Contributor

@neverchanje neverchanje commented Jan 10, 2024

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

We used to lack a test for sqlalchemy. The demo will be used for document. https://github.com/risingwavelabs/risingwave-docs/issues/1745

https://buildkite.com/risingwavelabs/integration-tests/builds/566 passed.

It should be noted that:

  1. When creating tables using sqlalchemy, it will somehow translate a BIGINT primary key into BIGSERIAL, which is not supported in RisingWave. As a workaround, I manually wrote the CREATE TABLE query in the test.
class User(Base):
    __tablename__ = 'users'

    id = Column(Integer, primary_key=True)
    name = Column(String)
    age = Column(Integer)

Base = declarative_base()
Base.metadata.create_all(engine)
# the automatic table creation will fail due to the incorrect translation from integer to serial.
  1. sqlalchemy was released 2.0 at the early 2023 and our driver may have some incompatibility issues with it. I did not test the 2.0 version since there is barely no tutorial available. Therefore, we should recommend users to try 1.4x versions for stability. The latest as of writing is 1.4.51

Checklist

  • I have added necessary unit tests and integration tests

@github-actions github-actions bot added the component/test Test related issue. label Jan 10, 2024
@neverchanje neverchanje requested review from lmatz and yuhao-su January 10, 2024 11:48
@yuhao-su
Copy link
Contributor

@neverchanje neverchanje marked this pull request as ready for review January 13, 2024 13:59
@neverchanje neverchanje enabled auto-merge January 13, 2024 14:01
@neverchanje neverchanje added this pull request to the merge queue Jan 13, 2024
Merged via the queue into main with commit 7c3edb1 Jan 13, 2024
47 checks passed
@neverchanje neverchanje deleted the wt-sqlalchemy branch January 13, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/test Test related issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants