-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -427,11 +427,19 @@ | |
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"100%|██████████| 8654/8654 [19:25<00:00, 7.42it/s]\n", | ||
" 50%|█████ | 1878/3754 [07:55<08:05, 3.86it/s]" | ||
"ename": "KeyboardInterrupt", | ||
"evalue": "", | ||
"output_type": "error", | ||
"traceback": [ | ||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", | ||
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", | ||
"\u001b[1;32m/Users/emanuelesalonico/Library/CloudStorage/[email protected]/My Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb Cell 5\u001b[0m in \u001b[0;36m<cell line: 14>\u001b[0;34m()\u001b[0m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39msrc\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mflight_analysis\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mapis\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mflightconnections\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39mfc\u001b[39;00m\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=6'>7</a>\u001b[0m db \u001b[39m=\u001b[39m Database(\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=7'>8</a>\u001b[0m db_host\u001b[39m=\u001b[39mprivate\u001b[39m.\u001b[39mDB_HOST,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=8'>9</a>\u001b[0m db_name\u001b[39m=\u001b[39mprivate\u001b[39m.\u001b[39mDB_NAME,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=9'>10</a>\u001b[0m db_user\u001b[39m=\u001b[39mprivate\u001b[39m.\u001b[39mDB_USER,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=10'>11</a>\u001b[0m db_pw\u001b[39m=\u001b[39mprivate\u001b[39m.\u001b[39mDB_PW,\n\u001b[1;32m <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=11'>12</a>\u001b[0m )\n\u001b[0;32m---> <a href='vscode-notebook-cell:/Users/emanuelesalonico/Library/CloudStorage/GoogleDrive-esalonico%40gmail.com/My%20Drive/SYNC/Dev/flight-analysis/flight_analysis.ipynb#X54sZmlsZQ%3D%3D?line=13'>14</a>\u001b[0m db\u001b[39m.\u001b[39;49mprepare_db_and_tables()\n", | ||
"File \u001b[0;32m~/Library/CloudStorage/[email protected]/My Drive/SYNC/Dev/flight-analysis/src/flight_analysis/database.py:336\u001b[0m, in \u001b[0;36mDatabase.prepare_db_and_tables\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 334\u001b[0m \u001b[39m# create data_connections table\u001b[39;00m\n\u001b[1;32m 335\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mdata_connections\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mlist_all_tables():\n\u001b[0;32m--> 336\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mcreate_data_connections_table()\n\u001b[1;32m 338\u001b[0m \u001b[39m# create scraped table\u001b[39;00m\n\u001b[1;32m 339\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mtable_scraped \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mlist_all_tables():\n", | ||
"File \u001b[0;32m~/Library/CloudStorage/[email protected]/My Drive/SYNC/Dev/flight-analysis/src/flight_analysis/database.py:252\u001b[0m, in \u001b[0;36mDatabase.create_data_connections_table\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 250\u001b[0m \u001b[39m# add airports data to table\u001b[39;00m\n\u001b[1;32m 251\u001b[0m logger\u001b[39m.\u001b[39minfo(\u001b[39m\"\u001b[39m\u001b[39mAdding connections data to table [data_connections]...\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[0;32m--> 252\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49madd_pandas_df_to_db(connections_df, table_name\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mdata_connections\u001b[39;49m\u001b[39m\"\u001b[39;49m)\n", | ||
"File \u001b[0;32m~/Library/CloudStorage/[email protected]/My Drive/SYNC/Dev/flight-analysis/src/flight_analysis/database.py:369\u001b[0m, in \u001b[0;36mDatabase.add_pandas_df_to_db\u001b[0;34m(self, df, table_name)\u001b[0m\n\u001b[1;32m 367\u001b[0m query \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mINSERT INTO \u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m(\u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m) VALUES \u001b[39m\u001b[39m%%\u001b[39;00m\u001b[39ms\u001b[39m\u001b[39m\"\u001b[39m \u001b[39m%\u001b[39m (table_name, cols)\n\u001b[1;32m 368\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 369\u001b[0m extras\u001b[39m.\u001b[39;49mexecute_values(cursor, query, tuples)\n\u001b[1;32m 370\u001b[0m logger\u001b[39m.\u001b[39minfo(\u001b[39m\"\u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m rows added to table [\u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m]\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(\u001b[39mlen\u001b[39m(df), table_name))\n\u001b[1;32m 371\u001b[0m \u001b[39mexcept\u001b[39;00m (\u001b[39mException\u001b[39;00m, psycopg2\u001b[39m.\u001b[39mDatabaseError) \u001b[39mas\u001b[39;00m error:\n", | ||
"File \u001b[0;32m~/miniforge3/envs/flight-analysis/lib/python3.10/site-packages/psycopg2/extras.py:1299\u001b[0m, in \u001b[0;36mexecute_values\u001b[0;34m(cur, sql, argslist, template, page_size, fetch)\u001b[0m\n\u001b[1;32m 1297\u001b[0m parts\u001b[39m.\u001b[39mappend(\u001b[39mb\u001b[39m\u001b[39m'\u001b[39m\u001b[39m,\u001b[39m\u001b[39m'\u001b[39m)\n\u001b[1;32m 1298\u001b[0m parts[\u001b[39m-\u001b[39m\u001b[39m1\u001b[39m:] \u001b[39m=\u001b[39m post\n\u001b[0;32m-> 1299\u001b[0m cur\u001b[39m.\u001b[39;49mexecute(\u001b[39mb\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39m'\u001b[39;49m\u001b[39m.\u001b[39;49mjoin(parts))\n\u001b[1;32m 1300\u001b[0m \u001b[39mif\u001b[39;00m fetch:\n\u001b[1;32m 1301\u001b[0m result\u001b[39m.\u001b[39mextend(cur\u001b[39m.\u001b[39mfetchall())\n", | ||
"File \u001b[0;32m~/miniforge3/envs/flight-analysis/lib/python3.10/encodings/utf_8.py:15\u001b[0m, in \u001b[0;36mdecode\u001b[0;34m(input, errors)\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[39m### Codec APIs\u001b[39;00m\n\u001b[1;32m 13\u001b[0m encode \u001b[39m=\u001b[39m codecs\u001b[39m.\u001b[39mutf_8_encode\n\u001b[0;32m---> 15\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mdecode\u001b[39m(\u001b[39minput\u001b[39m, errors\u001b[39m=\u001b[39m\u001b[39m'\u001b[39m\u001b[39mstrict\u001b[39m\u001b[39m'\u001b[39m):\n\u001b[1;32m 16\u001b[0m \u001b[39mreturn\u001b[39;00m codecs\u001b[39m.\u001b[39mutf_8_decode(\u001b[39minput\u001b[39m, errors, \u001b[39mTrue\u001b[39;00m)\n\u001b[1;32m 18\u001b[0m \u001b[39mclass\u001b[39;00m \u001b[39mIncrementalEncoder\u001b[39;00m(codecs\u001b[39m.\u001b[39mIncrementalEncoder):\n", | ||
"\u001b[0;31mKeyboardInterrupt\u001b[0m: " | ||
] | ||
} | ||
], | ||
|
@@ -449,8 +457,7 @@ | |
" db_pw=private.DB_PW,\n", | ||
")\n", | ||
"\n", | ||
"x = db.download_data_connections()\n", | ||
"x" | ||
"db.prepare_db_and_tables()" | ||
] | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters