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

Bug fixes / context refactor #32

Merged
merged 5 commits into from
Aug 23, 2021
Merged

Bug fixes / context refactor #32

merged 5 commits into from
Aug 23, 2021

Conversation

kminehart
Copy link
Collaborator

@kminehart kminehart commented Aug 19, 2021

Fixes #16

Before:

image

After:

image

Also includes fixes:

This does include a breaking change because of the new function on the interface.

Copy link
Collaborator

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

I have some minor comments, let me know what you think!

driver.go Outdated Show resolved Hide resolved
defer cancel()

ctx = tctx
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

it' a bit artificial but can we move lines 93:116 to a prepareQuery method? That way we can easily add tests for new/existing code without having to mock the query execution.

datasource.go Outdated Show resolved Hide resolved
query.go Outdated Show resolved Hide resolved
Comment on lines +165 to +173
count, err := frame.RowLen()

if err != nil {
return nil, err
}

if count == 0 {
return nil, ErrorNoResults
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

it'd be also great to have some test for this, since this is the fix of #16

driver.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

LGTM. I'd be great to have more tests but don't want to block this PR for that.

@kminehart
Copy link
Collaborator Author

LGTM. I'd be great to have more tests but don't want to block this PR for that.

I'm with you but I think I want to do some refactoring to make this more testable first 🙈

@kminehart kminehart merged commit cdfbeda into main Aug 23, 2021
@sasklacz sasklacz deleted the use-context branch January 9, 2023 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants