Skip to content
This repository was archived by the owner on Mar 18, 2022. It is now read-only.

Just some basic fixes I did just to run queries on both ODBC and REST#96

Open
3runkenzie wants to merge 1 commit intomarkhoerth:masterfrom
3runkenzie:odbc_fix
Open

Just some basic fixes I did just to run queries on both ODBC and REST#96
3runkenzie wants to merge 1 commit intomarkhoerth:masterfrom
3runkenzie:odbc_fix

Conversation

@3runkenzie
Copy link
Copy Markdown

@3runkenzie 3runkenzie commented Jul 1, 2020

These are just some issues/problems I found that I made quick fixes for (not PR worthy). These changes are expedient in nature and I didn't want to try to change the whole layout of the code base so I made some naive fixes.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 1, 2020

Codecov Report

Merging #96 into master will decrease coverage by 0.03%.
The diff coverage is 12.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #96      +/-   ##
==========================================
- Coverage   52.98%   52.94%   -0.04%     
==========================================
  Files          24       24              
  Lines        1576     1577       +1     
==========================================
  Hits          835      835              
- Misses        741      742       +1     
Impacted Files Coverage Δ
dremio_client/dremio_client.py 38.15% <0.00%> (-0.51%) ⬇️
dremio_client/query.py 30.76% <0.00%> (ø)
dremio_client/odbc.py 39.39% <33.33%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0b49981...5a604c4. Read the comment docs.

self._wlm_rules = list()
self._votes = list()
self._simple = SimpleClient(config)
#self._simple = SimpleClient(config) # took this off because I didn't know how it was intended to be used for now or in the future
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please leave this. Its a passthrough to get to the lower level api.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@3runkenzie was this still working in your tests without this removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes. I realized that, but I removed it because if I left it there, I couldn't get it to work.

flight:
port: 47470
rest:
port: 7183
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this should be 9047 as a default

Comment thread dremio_client/query.py
def query(
token,
base_url,
rest_url,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

rest_url takes the place of base_url so we can remove base_url here. But they are the same value so I don't understand the purpose?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes. I wanted to keep the parameters you had there initially (hence base_url does not get used) to incorporate a concept of having 2 types of urls.

self._rest_url = (
            ("https" if config["ssl"].get(bool) else "http")
            + "://"
            + self._hostname
            + (":{}".format(self._rest_port) if port else "")
        )
self._base_url = (
            ("https" if config["ssl"].get(bool) else "http")
            + "://"
            + self._hostname
            + (":{}".format(port) if port else "")
        )

since the ports are different for ODBC vs REST.

Comment thread dremio_client/odbc.py

_WINDOWS_DRIVER = "Dremio Connector"
_OSX_DRIVER = "Dremio ODBC Driver"
_OSX_DRIVER = "/Library/Dremio/ODBC/lib/libdrillodbc_sbu.dylib" # had to add this for the driver path
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

what happens if this is not changed? I thought the purpose of this was to fix #66 so that odbc worked w/o having to give absolute paths?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@rymurr the driver can not be found if this is not changed

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes. You are right. I was doing that on my end because pyodbc.drivers() returned an empty list so I included the full path for the Driver to get it to work.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants