Skip to content

Commit c1d5e8d

Browse files
committed
update notebook and fix logging level setup
1 parent af3e567 commit c1d5e8d

File tree

2 files changed

+49
-120
lines changed

2 files changed

+49
-120
lines changed

boilingdata.ipynb

Lines changed: 48 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "code",
58-
"execution_count": 4,
58+
"execution_count": 53,
5959
"id": "a849f659-1892-4e49-b7d4-b8b315750e13",
6060
"metadata": {},
6161
"outputs": [
@@ -64,7 +64,10 @@
6464
"output_type": "stream",
6565
"text": [
6666
"INFO:BoilingDataConnection:Connecting\n",
67-
"INFO:BoilingDataConnection:WS OPEN\n"
67+
"INFO:BoilingDataConnection:WS OPEN\n",
68+
"INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'starting'}\n",
69+
"INFO:BoilingDataConnection:{'name': 'QUERY_RUN', 'value': 'finished'}\n",
70+
"INFO:BoilingDataConnection:{'name': 'QUERY_RUN_MS', 'value': 59}\n"
6871
]
6972
}
7073
],
@@ -75,7 +78,7 @@
7578
"\n",
7679
"load_dotenv() # take environment variables from .env\n",
7780
"\n",
78-
"boiling = BoilingData()\n",
81+
"boiling = BoilingData(log_level=\"INFO\")\n",
7982
"await boiling.connect()\n",
8083
"\n",
8184
"async def bd(sql):\n",
@@ -86,73 +89,41 @@
8689
" return resp"
8790
]
8891
},
92+
{
93+
"cell_type": "markdown",
94+
"id": "394d22ad-61bf-41a1-aee9-719914572359",
95+
"metadata": {},
96+
"source": [
97+
"To get a list of Data Sets shared to you, you can call:"
98+
]
99+
},
89100
{
90101
"cell_type": "code",
91-
"execution_count": 5,
92-
"id": "74792890-15e8-486a-b507-1603bd5a5c15",
102+
"execution_count": 48,
103+
"id": "62c41e1d-cfaf-4a05-9407-23fe8d523da6",
93104
"metadata": {},
94105
"outputs": [
95106
{
96-
"data": {
97-
"text/html": [
98-
"<div>\n",
99-
"<style scoped>\n",
100-
" .dataframe tbody tr th:only-of-type {\n",
101-
" vertical-align: middle;\n",
102-
" }\n",
103-
"\n",
104-
" .dataframe tbody tr th {\n",
105-
" vertical-align: top;\n",
106-
" }\n",
107-
"\n",
108-
" .dataframe thead th {\n",
109-
" text-align: right;\n",
110-
" }\n",
111-
"</style>\n",
112-
"<table border=\"1\" class=\"dataframe\">\n",
113-
" <thead>\n",
114-
" <tr style=\"text-align: right;\">\n",
115-
" <th></th>\n",
116-
" <th>0</th>\n",
117-
" </tr>\n",
118-
" </thead>\n",
119-
" <tbody>\n",
120-
" <tr>\n",
121-
" <th>0</th>\n",
122-
" <td>demo_full</td>\n",
123-
" </tr>\n",
124-
" <tr>\n",
125-
" <th>1</th>\n",
126-
" <td>taxi_locations</td>\n",
127-
" </tr>\n",
128-
" <tr>\n",
129-
" <th>2</th>\n",
130-
" <td>taxi_locations_limited</td>\n",
131-
" </tr>\n",
132-
" </tbody>\n",
133-
"</table>\n",
134-
"</div>"
135-
],
136-
"text/plain": [
137-
" 0\n",
138-
"0 demo_full\n",
139-
"1 taxi_locations\n",
140-
"2 taxi_locations_limited"
141-
]
142-
},
143-
"execution_count": 5,
144-
"metadata": {},
145-
"output_type": "execute_result"
107+
"name": "stdout",
108+
"output_type": "stream",
109+
"text": [
110+
" shareName fromEmail lifeTime schedule\n",
111+
"0 taxi_locations demo@boilingdata.com 1h * * * * * *\n",
112+
"1 taxi_locations_limited dforsber@gmail.com 1h * * * * * *\n",
113+
"2 taxi_locations dforsber@gmail.com 1h * * * * * *\n",
114+
"3 demo_full dforsber@gmail.com 1h * * * * * *\n"
115+
]
146116
}
147117
],
148118
"source": [
149-
"await bd('SHOW TABLES')"
119+
"resp = await bd(\"SELECT shareName, fromEmail, lifeTime, schedule FROM boilingshares LIMIT 100\");\n",
120+
"print(resp)"
150121
]
151122
},
152123
{
153124
"cell_type": "code",
154-
"execution_count": 6,
155-
"id": "70bc3afc-d4a6-4eb3-8fb9-387d3a8ab40d",
125+
"execution_count": 49,
126+
"id": "6f294126-d81a-4e1c-bf6f-eec397759d1d",
156127
"metadata": {},
157128
"outputs": [
158129
{
@@ -176,91 +147,49 @@
176147
" <thead>\n",
177148
" <tr style=\"text-align: right;\">\n",
178149
" <th></th>\n",
179-
" <th>first_name</th>\n",
180-
" <th>email</th>\n",
150+
" <th>LocationID</th>\n",
151+
" <th>Borough</th>\n",
152+
" <th>Zone</th>\n",
153+
" <th>service_zone</th>\n",
181154
" </tr>\n",
182155
" </thead>\n",
183156
" <tbody>\n",
184157
" <tr>\n",
185158
" <th>0</th>\n",
186-
" <td>Amanda</td>\n",
187-
" <td>ajordan0@com.com</td>\n",
159+
" <td>1</td>\n",
160+
" <td>EWR</td>\n",
161+
" <td>Newark Airport</td>\n",
162+
" <td>EWR</td>\n",
188163
" </tr>\n",
189164
" <tr>\n",
190165
" <th>1</th>\n",
191-
" <td>Albert</td>\n",
192-
" <td>afreeman1@is.gd</td>\n",
193-
" </tr>\n",
194-
" <tr>\n",
195-
" <th>2</th>\n",
196-
" <td>Evelyn</td>\n",
197-
" <td>emorgan2@altervista.org</td>\n",
198-
" </tr>\n",
199-
" <tr>\n",
200-
" <th>3</th>\n",
201-
" <td>Denise</td>\n",
202-
" <td>driley3@gmpg.org</td>\n",
203-
" </tr>\n",
204-
" <tr>\n",
205-
" <th>4</th>\n",
206-
" <td>Carlos</td>\n",
207-
" <td>cburns4@miitbeian.gov.cn</td>\n",
208-
" </tr>\n",
209-
" <tr>\n",
210-
" <th>5</th>\n",
211-
" <td>Kathryn</td>\n",
212-
" <td>kwhite5@google.com</td>\n",
213-
" </tr>\n",
214-
" <tr>\n",
215-
" <th>6</th>\n",
216-
" <td>Samuel</td>\n",
217-
" <td>sholmes6@foxnews.com</td>\n",
218-
" </tr>\n",
219-
" <tr>\n",
220-
" <th>7</th>\n",
221-
" <td>Harry</td>\n",
222-
" <td>hhowell7@eepurl.com</td>\n",
223-
" </tr>\n",
224-
" <tr>\n",
225-
" <th>8</th>\n",
226-
" <td>Jose</td>\n",
227-
" <td>jfoster8@yelp.com</td>\n",
228-
" </tr>\n",
229-
" <tr>\n",
230-
" <th>9</th>\n",
231-
" <td>Emily</td>\n",
232-
" <td>estewart9@opensource.org</td>\n",
166+
" <td>2</td>\n",
167+
" <td>Queens</td>\n",
168+
" <td>Jamaica Bay</td>\n",
169+
" <td>Boro Zone</td>\n",
233170
" </tr>\n",
234171
" </tbody>\n",
235172
"</table>\n",
236173
"</div>"
237174
],
238175
"text/plain": [
239-
" first_name email\n",
240-
"0 Amanda ajordan0@com.com\n",
241-
"1 Albert afreeman1@is.gd\n",
242-
"2 Evelyn emorgan2@altervista.org\n",
243-
"3 Denise driley3@gmpg.org\n",
244-
"4 Carlos cburns4@miitbeian.gov.cn\n",
245-
"5 Kathryn kwhite5@google.com\n",
246-
"6 Samuel sholmes6@foxnews.com\n",
247-
"7 Harry hhowell7@eepurl.com\n",
248-
"8 Jose jfoster8@yelp.com\n",
249-
"9 Emily estewart9@opensource.org"
176+
" LocationID Borough Zone service_zone\n",
177+
"0 1 EWR Newark Airport EWR\n",
178+
"1 2 Queens Jamaica Bay Boro Zone"
250179
]
251180
},
252-
"execution_count": 6,
181+
"execution_count": 49,
253182
"metadata": {},
254183
"output_type": "execute_result"
255184
}
256185
],
257186
"source": [
258-
"await bd(\"SELECT first_name, email FROM parquet_scan('s3://boilingdata-demo/test.parquet') LIMIT 10\")"
187+
"await bd(\"SELECT * FROM share('dforsber@gmail.com:taxi_locations') LIMIT 2\")"
259188
]
260189
},
261190
{
262191
"cell_type": "code",
263-
"execution_count": 7,
192+
"execution_count": 52,
264193
"id": "715e0451-4a18-4415-a0cb-73d68d248843",
265194
"metadata": {},
266195
"outputs": [
@@ -503,7 +432,7 @@
503432
"9 1/28/1997 27234.28 Health Coach IV "
504433
]
505434
},
506-
"execution_count": 7,
435+
"execution_count": 52,
507436
"metadata": {},
508437
"output_type": "execute_result"
509438
}

py_boilingdata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _on_msg(self, ws_app, data):
212212
raise Exception(message)
213213
if log_level == "INFO":
214214
self.logger.info(message)
215-
if msg_type == "INFO" and self.log_level == "INFO":
215+
if msg_type == "INFO" and self.log_level == logging.INFO:
216216
self.logger.info(msg.get("info"))
217217
if msg_type == "LAMBDA_EVENT":
218218
lambda_event = msg.get("lambdaEvent")

0 commit comments

Comments
 (0)