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

fix(oracle, clickhouse): ensure port is captured in _from_url implementation #9507

Conversation

grieve54706
Copy link
Contributor

Description of changes

Fix oracle and clickhouse missing port in _from_url.

Copy link
Member

@gforsyth gforsyth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this in @grieve54706 !

One small request around checking that the port parsing is working as expected (and to contrast it to the behavior when the port is incorrect)



def test_invalid_port(con):
port = 9999
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a successful connection using the correct port at the beginning of this test to show that the port is being correctly parsed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice idea. I will add a successful test case. Thanks.

@gforsyth gforsyth changed the title fix(backend): ensure port is captured in Oracle and ClickHouse _from_url implementation fix(oracle, clickhouse): ensure port is captured in _from_url implementation Jul 3, 2024
Comment on lines +89 to +95
port = 9999
url = f"oracle://{ORACLE_USER}:{ORACLE_PASS}@{ORACLE_HOST}:{port}/IBIS_TESTING"
with pytest.raises(
oracledb.OperationalError,
match="DPY-6005: cannot connect to database",
):
ibis.connect(url)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, same request here, too, re: adding a successful connection

Copy link
Contributor Author

@grieve54706 grieve54706 Jul 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the test_from_url is enough proof. WDYT?

def test_from_url(con):
    new_con = ibis.connect("oracle://ibis:ibis@localhost:1521/IBIS_TESTING")

    assert new_con.list_tables()

@grieve54706 grieve54706 requested a review from gforsyth July 4, 2024 03:07
@grieve54706 grieve54706 force-pushed the bugfix/missing-port-in-connection-string branch 4 times, most recently from cab3414 to 9b6d8d6 Compare July 8, 2024 03:03
@grieve54706 grieve54706 force-pushed the bugfix/missing-port-in-connection-string branch from 9b6d8d6 to 405d752 Compare July 8, 2024 03:03
Copy link
Member

@gforsyth gforsyth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for putting this together @grieve54706 !

@gforsyth gforsyth merged commit bd3009a into ibis-project:main Jul 9, 2024
76 checks passed
@grieve54706
Copy link
Contributor Author

Thanks @gforsyth. Thank you for your time.

@grieve54706 grieve54706 deleted the bugfix/missing-port-in-connection-string branch July 10, 2024 02:57
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.

2 participants