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

Set port correctly in mssql connection string #731

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

steinitzu
Copy link
Collaborator

Resolves #721

Fixes odbc connection string to use SERVER=hostname,port instead of SERVER=hostname;PORT=port

@steinitzu steinitzu requested a review from rudolfix November 1, 2023 16:53
Copy link

netlify bot commented Nov 1, 2023

Deploy Preview for dlt-hub-docs canceled.

Name Link
🔨 Latest commit 835c49c
🔍 Latest deploy log https://app.netlify.com/sites/dlt-hub-docs/deploys/65492ac4180bf40007ac9fcf

Copy link
Collaborator

@rudolfix rudolfix left a comment

Choose a reason for hiding this comment

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

fix is good! but arrow test is flaky. IMO

rows = [list(row) for row in select_data(pipeline, f"SELECT * FROM {qual_name} ORDER BY 1")]

you order by _dlt_id which is first AFAIK in the table, then

expected = sorted([list(r.values()) for r in records], key=lambda x: x[0])

you order by first data element (of string type)

and later it works if you are lucky :)

@steinitzu
Copy link
Collaborator Author

fix is good! but arrow test is flaky. IMO

rows = [list(row) for row in select_data(pipeline, f"SELECT * FROM {qual_name} ORDER BY 1")]

you order by _dlt_id which is first AFAIK in the table, then

expected = sorted([list(r.values()) for r in records], key=lambda x: x[0])

you order by first data element (of string type)

and later it works if you are lucky :)

True, I missed that. 😬
Will make this deterministic.

Copy link
Collaborator

@rudolfix rudolfix left a comment

Choose a reason for hiding this comment

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

LGTM

@rudolfix rudolfix merged commit 1f65ada into devel Nov 8, 2023
39 of 44 checks passed
@rudolfix rudolfix deleted the sthor/fix-mssql-dsn-port branch November 8, 2023 11:51
result = {k: v for k, v in (param.split('=') for param in dsn.split(";"))}

assert result == {
'DRIVER': 'ODBC Driver 18 for SQL Server',

Choose a reason for hiding this comment

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

Amazing that the fix came so quickly! :)
I haven't looked into the codebase yet, so maybe my question is misunderstood;
Would this test fail for a developer who only have driver 17 installed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good catch, that's true it would fail.
The test should specify the driver or ignore it in the assert.

@JonasDavisFondene
Copy link

JonasDavisFondene commented Nov 15, 2023

Is this not included in any release yet?
I see this merged into devel and version = "0.3.24" in devel pyproject.toml, but when I install 0.3.24 the credentials file is not updated, and I cant find #731 in any release here: https://github.com/dlt-hub/dlt/releases

Oh so devel stands for develop, I guess im just confused about what branch pip installs from, probably not the best place for such a question to be placed in comments here :)

@rudolfix
Copy link
Collaborator

@JonasDavisFondene it is not yet included. we still prepare this week's release. we tag the commits with version number so you can see if the PR was merged before or after certain tag. this is not visible in commit history but in the release you can click on the tag and see what got included. not user friendly though...

@JonasDavisFondene
Copy link

JonasDavisFondene commented Nov 21, 2023

apart from the Driver 18 test independency suggestion, it would also be nice with some case insensitivity for parameter keys:
master...JonasDavisFondene:dlt:patch-2
master...JonasDavisFondene:dlt:patch-3

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.

Port should be part of server name separated by , for mssql pyodbc connection strings
3 participants