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

vdk-core: get_managed_connection should return opened connection #1410

Merged
merged 5 commits into from
Dec 15, 2022

Conversation

antoniivanov
Copy link
Collaborator

Currently job_input.get_managed_connection() return the current managed connection which may not be opened if it's called for a first time. THis may lead to subtle bugs e.g

pandas.to_sql(sql, con = job_input.get_managed_connection())

will return error if job_input.execute_query has not be run before. But will succeed if it's not . That's clearly error prone and also it's unnecessary to force users to called
job_input.get_managed_connection().connect() explicitly).

Testing Done: functional test

Signed-off-by: Antoni Ivanov aivanov@vmware.com

@antoniivanov
Copy link
Collaborator Author

Thanks for the feedback Iva. I will address it next week at some point (after I am back).

Currently job_input.get_managed_connection() return the current managed
connection which may not be opened if it's called for a first time. THis
may lead to subtle bugs e.g

```
pandas.to_sql(sql, con = job_input.get_managed_connection())
```

will return error if job_input.execute_query has not be run before. But
will succeed if it's not . That's clearly error prone and also it's
unnecessary to force users to called
job_input.get_managed_connection().connect() explicitly).

Testing Done: functional test

Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
to be squashed

Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
Signed-off-by: Antoni Ivanov <aivanov@vmware.com>
@antoniivanov antoniivanov enabled auto-merge (rebase) December 15, 2022 11:52
@antoniivanov antoniivanov merged commit 6017910 into main Dec 15, 2022
@antoniivanov antoniivanov deleted the person/aivanov/managed-conn branch December 15, 2022 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants