msk_cdm.dremio
DremioAPI
¶
Bases: object
Object to simplify reading from Dremio (CDSI's SQL engine).
Source code in msk_cdm/dremio/_dremio_api.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
__init__(*, fname_env, env_key_user='USER', env_key_pw='PW', scheme='grpc+tcp', hostname='tlvidreamcord1', flightport=32010)
¶
Initialization
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fname_env |
str
|
Environment file with username and pw |
required |
env_key_user |
Optional[str]
|
Key term to identify the username in fname_env |
'USER'
|
env_key_pw |
Optional[str]
|
Key term to identify the password in fname_env |
'PW'
|
scheme |
Optional[str]
|
The connection scheme used |
'grpc+tcp'
|
hostname |
Optional[str]
|
Server hostname |
'tlvidreamcord1'
|
flightport |
Optional[int]
|
Port number |
32010
|
Source code in msk_cdm/dremio/_dremio_api.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
query_data(sql)
¶
Query Dremio with SQL string
Parameters:
Name | Type | Description | Default |
---|---|---|---|
sql |
SQL string used to query Dremio |
required |
Returns:
Type | Description |
---|---|
df_output |
Source code in msk_cdm/dremio/_dremio_api.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
return_data()
¶
Return data queried from Dremio in a Pandas dataframe
Returns:
Type | Description |
---|---|
df |
Source code in msk_cdm/dremio/_dremio_api.py
42 43 44 45 46 47 48 49 50 51 |
|
DremioClientAuthMiddleware
¶
Bases: ClientMiddleware
A ClientMiddleware that extracts the bearer token from the authorization header returned by the Dremio Flight Server Endpoint. Parameters
factory : ClientHeaderAuthMiddlewareFactory The factory to set call credentials if an authorization header with bearer token is returned by the Dremio server.
Source code in msk_cdm/dremio/_dremio_api.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 |
|
DremioClientAuthMiddlewareFactory
¶
Bases: ClientMiddlewareFactory
A factory that creates DremioClientAuthMiddleware(s).
Source code in msk_cdm/dremio/_dremio_api.py
109 110 111 112 113 114 115 116 117 118 119 |
|