|
92 | 92 | }, |
93 | 93 | { |
94 | 94 | "cell_type": "code", |
95 | | - "execution_count": 2, |
| 95 | + "execution_count": 10, |
96 | 96 | "id": "a849f659-1892-4e49-b7d4-b8b315750e13", |
97 | 97 | "metadata": {}, |
98 | | - "outputs": [ |
99 | | - { |
100 | | - "name": "stderr", |
101 | | - "output_type": "stream", |
102 | | - "text": [ |
103 | | - "INFO:BoilingDataConnection:Connecting\n", |
104 | | - "INFO:BoilingDataConnection:WS OPEN\n", |
105 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'starting'}\n", |
106 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'finished'}\n", |
107 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN_MS', 'value': 55}\n" |
108 | | - ] |
109 | | - } |
110 | | - ], |
| 98 | + "outputs": [], |
111 | 99 | "source": [ |
112 | 100 | "import pandas as pd\n", |
113 | 101 | "from dotenv import load_dotenv\n", |
114 | 102 | "from py_boilingdata import BoilingData\n", |
115 | 103 | "\n", |
116 | 104 | "load_dotenv() # take environment variables from .env\n", |
117 | 105 | "\n", |
118 | | - "boiling = BoilingData(log_level=\"INFO\")\n", |
| 106 | + "# You can turn off the messages by raising the log level to 'ERROR'\n", |
| 107 | + "boiling = BoilingData(log_level=\"ERROR\")\n", |
119 | 108 | "await boiling.connect()\n", |
120 | 109 | "\n", |
121 | 110 | "async def bd(sql):\n", |
122 | 111 | " resp = await boiling.execute(sql)\n", |
123 | 112 | " try:\n", |
124 | 113 | " return pd.DataFrame(resp)\n", |
125 | 114 | " except:\n", |
| 115 | + " print(resp)\n", |
126 | 116 | " return resp" |
127 | 117 | ] |
128 | 118 | }, |
|
138 | 128 | }, |
139 | 129 | { |
140 | 130 | "cell_type": "code", |
141 | | - "execution_count": 3, |
| 131 | + "execution_count": 8, |
142 | 132 | "id": "62c41e1d-cfaf-4a05-9407-23fe8d523da6", |
143 | 133 | "metadata": {}, |
144 | 134 | "outputs": [ |
145 | 135 | { |
146 | | - "name": "stderr", |
147 | | - "output_type": "stream", |
148 | | - "text": [ |
149 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'starting'}\n" |
150 | | - ] |
151 | | - }, |
152 | | - { |
153 | | - "name": "stdout", |
154 | | - "output_type": "stream", |
155 | | - "text": [ |
156 | | - " shareName fromEmail lifeTime schedule\n", |
157 | | - "0 taxi_locations demo@boilingdata.com 1h * * * * * *\n", |
158 | | - "1 taxi_locations_limited dforsber@gmail.com 1h * * * * * *\n", |
159 | | - "2 taxi_locations dforsber@gmail.com 1h * * * * * *\n", |
160 | | - "3 demo_full dforsber@gmail.com 1h * * * * * *\n" |
161 | | - ] |
162 | | - }, |
163 | | - { |
164 | | - "name": "stderr", |
165 | | - "output_type": "stream", |
166 | | - "text": [ |
167 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'finished'}\n", |
168 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN_MS', 'value': 224}\n" |
169 | | - ] |
| 136 | + "data": { |
| 137 | + "text/html": [ |
| 138 | + "<div>\n", |
| 139 | + "<style scoped>\n", |
| 140 | + " .dataframe tbody tr th:only-of-type {\n", |
| 141 | + " vertical-align: middle;\n", |
| 142 | + " }\n", |
| 143 | + "\n", |
| 144 | + " .dataframe tbody tr th {\n", |
| 145 | + " vertical-align: top;\n", |
| 146 | + " }\n", |
| 147 | + "\n", |
| 148 | + " .dataframe thead th {\n", |
| 149 | + " text-align: right;\n", |
| 150 | + " }\n", |
| 151 | + "</style>\n", |
| 152 | + "<table border=\"1\" class=\"dataframe\">\n", |
| 153 | + " <thead>\n", |
| 154 | + " <tr style=\"text-align: right;\">\n", |
| 155 | + " <th></th>\n", |
| 156 | + " <th>shareName</th>\n", |
| 157 | + " <th>fromEmail</th>\n", |
| 158 | + " <th>lifeTime</th>\n", |
| 159 | + " <th>schedule</th>\n", |
| 160 | + " </tr>\n", |
| 161 | + " </thead>\n", |
| 162 | + " <tbody>\n", |
| 163 | + " <tr>\n", |
| 164 | + " <th>0</th>\n", |
| 165 | + " <td>taxi_locations</td>\n", |
| 166 | + " <td>demo@boilingdata.com</td>\n", |
| 167 | + " <td>1h</td>\n", |
| 168 | + " <td>* * * * * *</td>\n", |
| 169 | + " </tr>\n", |
| 170 | + " <tr>\n", |
| 171 | + " <th>1</th>\n", |
| 172 | + " <td>taxi_locations_limited</td>\n", |
| 173 | + " <td>dforsber@gmail.com</td>\n", |
| 174 | + " <td>1h</td>\n", |
| 175 | + " <td>* * * * * *</td>\n", |
| 176 | + " </tr>\n", |
| 177 | + " <tr>\n", |
| 178 | + " <th>2</th>\n", |
| 179 | + " <td>taxi_locations</td>\n", |
| 180 | + " <td>dforsber@gmail.com</td>\n", |
| 181 | + " <td>1h</td>\n", |
| 182 | + " <td>* * * * * *</td>\n", |
| 183 | + " </tr>\n", |
| 184 | + " <tr>\n", |
| 185 | + " <th>3</th>\n", |
| 186 | + " <td>demo_full</td>\n", |
| 187 | + " <td>dforsber@gmail.com</td>\n", |
| 188 | + " <td>1h</td>\n", |
| 189 | + " <td>* * * * * *</td>\n", |
| 190 | + " </tr>\n", |
| 191 | + " </tbody>\n", |
| 192 | + "</table>\n", |
| 193 | + "</div>" |
| 194 | + ], |
| 195 | + "text/plain": [ |
| 196 | + " shareName fromEmail lifeTime schedule\n", |
| 197 | + "0 taxi_locations demo@boilingdata.com 1h * * * * * *\n", |
| 198 | + "1 taxi_locations_limited dforsber@gmail.com 1h * * * * * *\n", |
| 199 | + "2 taxi_locations dforsber@gmail.com 1h * * * * * *\n", |
| 200 | + "3 demo_full dforsber@gmail.com 1h * * * * * *" |
| 201 | + ] |
| 202 | + }, |
| 203 | + "execution_count": 8, |
| 204 | + "metadata": {}, |
| 205 | + "output_type": "execute_result" |
170 | 206 | } |
171 | 207 | ], |
172 | 208 | "source": [ |
173 | | - "resp = await bd(\"SELECT shareName, fromEmail, lifeTime, schedule FROM boilingshares LIMIT 100;\")\n", |
174 | | - "print(resp)" |
| 209 | + "await bd(\"SELECT shareName, fromEmail, lifeTime, schedule FROM boilingshares LIMIT 100;\")" |
175 | 210 | ] |
176 | 211 | }, |
177 | 212 | { |
178 | | - "cell_type": "code", |
179 | | - "execution_count": null, |
180 | | - "id": "7e56f5ef-6856-4caf-a347-779049cae17a", |
| 213 | + "cell_type": "markdown", |
| 214 | + "id": "89e9cca6-c3af-4ea3-b293-54898d338e7c", |
181 | 215 | "metadata": {}, |
182 | | - "outputs": [], |
183 | 216 | "source": [ |
184 | 217 | "In this run, I have data set called `taxi_locations` shared for me by `dforsber@gmail.com`. I can query it like this: " |
185 | 218 | ] |
186 | 219 | }, |
187 | 220 | { |
188 | 221 | "cell_type": "code", |
189 | | - "execution_count": 3, |
| 222 | + "execution_count": 9, |
190 | 223 | "id": "6f294126-d81a-4e1c-bf6f-eec397759d1d", |
191 | 224 | "metadata": {}, |
192 | 225 | "outputs": [ |
|
242 | 275 | "1 2 Queens Jamaica Bay Boro Zone" |
243 | 276 | ] |
244 | 277 | }, |
245 | | - "execution_count": 3, |
| 278 | + "execution_count": 9, |
246 | 279 | "metadata": {}, |
247 | 280 | "output_type": "execute_result" |
248 | 281 | } |
|
263 | 296 | }, |
264 | 297 | { |
265 | 298 | "cell_type": "code", |
266 | | - "execution_count": 5, |
| 299 | + "execution_count": 11, |
267 | 300 | "id": "715e0451-4a18-4415-a0cb-73d68d248843", |
268 | 301 | "metadata": {}, |
269 | 302 | "outputs": [ |
|
411 | 444 | "4 NaN " |
412 | 445 | ] |
413 | 446 | }, |
414 | | - "execution_count": 5, |
| 447 | + "execution_count": 11, |
415 | 448 | "metadata": {}, |
416 | 449 | "output_type": "execute_result" |
417 | 450 | } |
|
432 | 465 | }, |
433 | 466 | { |
434 | 467 | "cell_type": "code", |
435 | | - "execution_count": 5, |
| 468 | + "execution_count": 12, |
436 | 469 | "id": "012cfa74-8664-4398-87fa-c12dce698f86", |
437 | 470 | "metadata": {}, |
438 | 471 | "outputs": [ |
439 | | - { |
440 | | - "name": "stderr", |
441 | | - "output_type": "stream", |
442 | | - "text": [ |
443 | | - "INFO:BoilingDataConnection:Listing Buckets\n", |
444 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'starting'}\n" |
445 | | - ] |
446 | | - }, |
447 | 472 | { |
448 | 473 | "data": { |
449 | 474 | "text/html": [ |
|
490 | 515 | "1 boilingdata-user 2021-12-06T12:06:12.060Z" |
491 | 516 | ] |
492 | 517 | }, |
493 | | - "execution_count": 5, |
| 518 | + "execution_count": 12, |
494 | 519 | "metadata": {}, |
495 | 520 | "output_type": "execute_result" |
496 | | - }, |
497 | | - { |
498 | | - "name": "stderr", |
499 | | - "output_type": "stream", |
500 | | - "text": [ |
501 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'finished'}\n", |
502 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN_MS', 'value': 74}\n" |
503 | | - ] |
504 | 521 | } |
505 | 522 | ], |
506 | 523 | "source": [ |
|
509 | 526 | }, |
510 | 527 | { |
511 | 528 | "cell_type": "code", |
512 | | - "execution_count": 6, |
| 529 | + "execution_count": 13, |
513 | 530 | "id": "097a28c9-3424-47da-82a4-2daf2948de02", |
514 | 531 | "metadata": {}, |
515 | 532 | "outputs": [ |
516 | | - { |
517 | | - "name": "stderr", |
518 | | - "output_type": "stream", |
519 | | - "text": [ |
520 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'starting'}\n", |
521 | | - "INFO:BoilingDataConnection:Listing s3://boilingdata-demo/\n" |
522 | | - ] |
523 | | - }, |
524 | 533 | { |
525 | 534 | "data": { |
526 | 535 | "text/html": [ |
|
743 | 752 | "14 test_folder2/ " |
744 | 753 | ] |
745 | 754 | }, |
746 | | - "execution_count": 6, |
| 755 | + "execution_count": 13, |
747 | 756 | "metadata": {}, |
748 | 757 | "output_type": "execute_result" |
749 | | - }, |
750 | | - { |
751 | | - "name": "stderr", |
752 | | - "output_type": "stream", |
753 | | - "text": [ |
754 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'finished'}\n", |
755 | | - "INFO:BoilingDataConnection:{'name': 'QUERY_RUN_MS', 'value': 103}\n" |
756 | | - ] |
757 | 758 | } |
758 | 759 | ], |
759 | 760 | "source": [ |
|
0 commit comments