|
18 | 18 | }, |
19 | 19 | { |
20 | 20 | "cell_type": "code", |
21 | | - "execution_count": null, |
22 | | - "id": "0a26a1bc", |
| 21 | + "execution_count": 1, |
| 22 | + "id": "9e504af7", |
23 | 23 | "metadata": {}, |
24 | 24 | "outputs": [], |
25 | 25 | "source": [ |
| 26 | + "%load_ext dotenv\n", |
| 27 | + "%dotenv\n", |
| 28 | + "\n", |
26 | 29 | "import pandas as pd\n", |
27 | 30 | "import datetime\n", |
28 | 31 | "import os\n", |
29 | | - "from utils import createEngine\n", |
30 | 32 | "import uuid\n", |
31 | 33 | "import numpy as np\n", |
32 | 34 | "import warnings\n", |
33 | | - "from pangres import upsert\n", |
34 | | - "from urllib.parse import urljoin\n", |
35 | 35 | "import requests\n", |
36 | 36 | "import zipfile\n", |
37 | 37 | "import io\n", |
| 38 | + "import sys\n", |
| 39 | + "from pathlib import Path\n", |
| 40 | + "from pangres import upsert\n", |
| 41 | + "from urllib.parse import urljoin\n", |
| 42 | + "\n", |
| 43 | + "\n", |
| 44 | + "# This allows us to use an absolute import for utils\n", |
| 45 | + "parent_dir = str(Path().resolve().parents[0])\n", |
| 46 | + "if parent_dir not in sys.path:\n", |
| 47 | + " sys.path.insert(0, parent_dir)\n", |
| 48 | + "\n", |
| 49 | + "from utils.db_helpers import createEngine\n", |
38 | 50 | "\n", |
39 | 51 | "warnings.simplefilter(action='ignore', category=pd.errors.DtypeWarning)\n", |
40 | 52 | "warnings.simplefilter(\n", |
41 | | - " action='ignore', category=pd.errors.SettingWithCopyWarning)\n" |
| 53 | + " action='ignore', category=pd.errors.SettingWithCopyWarning)" |
42 | 54 | ] |
43 | 55 | }, |
44 | 56 | { |
|
95 | 107 | }, |
96 | 108 | { |
97 | 109 | "cell_type": "code", |
98 | | - "execution_count": null, |
| 110 | + "execution_count": 2, |
99 | 111 | "id": "09f9d8b4", |
100 | 112 | "metadata": {}, |
101 | 113 | "outputs": [], |
102 | 114 | "source": [ |
103 | | - "engine = createEngine()" |
| 115 | + "engine = createEngine(\"SOURCE\")" |
104 | 116 | ] |
105 | 117 | }, |
106 | 118 | { |
|
0 commit comments