diff --git a/.gitignore b/.gitignore
index eb9c215b..f683c9d6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,8 @@ tests/__pycache__/
**/*.Rproj.user/
**/*.Rproj/
**/*.Rhistory
+**/*.Rdata
+**/*.RData
.vscode/settings.json
diff --git a/Makefile b/Makefile
index dffea7a8..822942a6 100755
--- a/Makefile
+++ b/Makefile
@@ -22,12 +22,6 @@ test_all: FORCE
test_notebooks: FORCE
./scripts/test_notebooks.sh
-done: FORCE
- ./scripts/clean.sh
- ./scripts/lint.sh
- ./scripts/test.sh
- ./scripts/test_notebooks.sh
-
api/requirements.txt: FORCE
pip-compile --extra api --output-file api/requirements.txt
diff --git a/cities/deployment/tracts_minneapolis/generate_torch_loader.py b/cities/deployment/tracts_minneapolis/generate_torch_loader.py
index e29e4d41..d12b88f7 100644
--- a/cities/deployment/tracts_minneapolis/generate_torch_loader.py
+++ b/cities/deployment/tracts_minneapolis/generate_torch_loader.py
@@ -2,14 +2,21 @@
import time
import sqlalchemy
+import torch
+from dotenv import load_dotenv
-from cities.utils.data_loader import select_from_sql
+from cities.utils.data_grabber import find_repo_root
+from cities.utils.data_loader import ZoningDataset, select_from_sql
+
+load_dotenv()
# local torch loader is needed for subsampling in evaluation, comparison to the previous dataset and useful for EDA
-USERNAME = os.getenv("USERNAME")
+
+DB_USERNAME = os.getenv("DB_USERNAME")
HOST = os.getenv("HOST")
DATABASE = os.getenv("DATABASE")
+PASSWORD = os.getenv("PASSWORD")
#####################
# data load and prep
@@ -19,20 +26,23 @@
"categorical": ["year", "census_tract"],
"continuous": {
"housing_units",
+ "housing_units_original",
"total_value",
+ "total_value_original",
"median_value",
"mean_limit_original",
"median_distance",
"income",
"segregation_original",
"white_original",
+ "parcel_sqm",
},
"outcome": "housing_units",
}
load_start = time.time()
with sqlalchemy.create_engine(
- f"postgresql://{USERNAME}@{HOST}/{DATABASE}"
+ f"postgresql://{DB_USERNAME}:{PASSWORD}@{HOST}/{DATABASE}"
).connect() as conn:
subset = select_from_sql(
"select * from dev.tracts_model__census_tracts order by census_tract, year",
@@ -41,3 +51,35 @@
)
load_end = time.time()
print(f"Data loaded in {load_end - load_start} seconds")
+
+
+columns_to_standardize = [
+ "housing_units_original",
+ "total_value_original",
+]
+
+new_standardization_dict = {}
+
+for column in columns_to_standardize:
+ new_standardization_dict[column] = {
+ "mean": subset["continuous"][column].mean(),
+ "std": subset["continuous"][column].std(),
+ }
+
+
+assert "parcel_sqm" in subset["continuous"].keys()
+
+root = find_repo_root()
+
+pg_census_tracts_dataset = ZoningDataset(
+ subset["categorical"],
+ subset["continuous"],
+ standardization_dictionary=new_standardization_dict,
+)
+assert "parcel_sqm" in subset["continuous"].keys()
+
+pg_census_tracts_data_path = os.path.join(
+ root, "data/minneapolis/processed/pg_census_tracts_dataset.pt"
+)
+
+torch.save(pg_census_tracts_dataset, pg_census_tracts_data_path)
diff --git a/cities/deployment/tracts_minneapolis/predict.py b/cities/deployment/tracts_minneapolis/predict.py
index 5096ee19..d34f7735 100644
--- a/cities/deployment/tracts_minneapolis/predict.py
+++ b/cities/deployment/tracts_minneapolis/predict.py
@@ -7,13 +7,25 @@
import sqlalchemy
import torch
from chirho.counterfactual.handlers import MultiWorldCounterfactual
+from chirho.indexed.ops import IndexSet, gather
from chirho.interventional.handlers import do
+from dotenv import load_dotenv
from pyro.infer import Predictive
-from cities.modeling.zoning_models.zoning_tracts_model import TractsModel
+from cities.modeling.zoning_models.zoning_tracts_sqm_model import (
+ TractsModelSqm as TractsModel,
+)
from cities.utils.data_grabber import find_repo_root
from cities.utils.data_loader import select_from_data, select_from_sql
+load_dotenv()
+
+
+DB_USERNAME = os.getenv("DB_USERNAME")
+HOST = os.getenv("HOST")
+DATABASE = os.getenv("DATABASE")
+PASSWORD = os.getenv("PASSWORD")
+
class TractsModelPredictor:
kwargs = {
@@ -28,6 +40,7 @@ class TractsModelPredictor:
"segregation_original",
"white_original",
"housing_units_original",
+ "parcel_sqm",
},
"outcome": "housing_units",
}
@@ -43,6 +56,7 @@ class TractsModelPredictor:
"income",
"segregation_original",
"white_original",
+ "parcel_sqm",
},
"outcome": "housing_units",
}
@@ -89,7 +103,6 @@ def __init__(self, conn):
deploy_path = os.path.join(root, "cities/deployment/tracts_minneapolis")
guide_path = os.path.join(deploy_path, "tracts_model_guide.pkl")
- print("guide path", guide_path)
with open(guide_path, "rb") as file:
guide = dill.load(file)
@@ -150,11 +163,21 @@ def predict(self, conn, intervention=None):
else:
intervention = self._tracts_intervention(conn, **intervention)
print(intervention.shape, intervention)
- with MultiWorldCounterfactual():
- with do(actions={"limit": intervention}):
- result = self.predictive(**subset_for_preds)[
- "housing_units"
- ].squeeze()[:, 1, :]
+ # with MultiWorldCounterfactual():
+ # with do(actions={"limit": intervention}):
+ # result = self.predictive(**subset_for_preds)[
+ # "housing_units"
+ # ].squeeze()[:, 1, :]
+
+ # RU: if you use mwc, you should not use squeezing and indexing to look into possible worlds.
+ # There is a nicer and more robust way to do so is:
+ with MultiWorldCounterfactual() as mwc:
+ with do(actions={"limit": intervention}):
+ result_all = self.predictive(**subset_for_preds)["housing_units"]
+ with mwc:
+ result = gather(
+ result_all, IndexSet(**{"limit": {1}}), event_dims=0
+ ).squeeze()
# undo standardization
result = result * self.housing_units_std + self.housing_units_mean
@@ -236,7 +259,7 @@ def predict_cumulative(self, conn, intervention):
PASSWORD = os.getenv("PASSWORD")
with sqlalchemy.create_engine(
- f"postgresql://{USERNAME}:{PASSWORD}@{HOST}/{DATABASE}"
+ f"postgresql://{DB_USERNAME}:{PASSWORD}@{HOST}/{DATABASE}"
).connect() as conn:
predictor = TractsModelPredictor(conn)
start = time.time()
diff --git a/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_dag_plot_high_density.png b/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_dag_plot_high_density.png
index a3e337a5..e6e5f6cc 100644
Binary files a/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_dag_plot_high_density.png and b/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_dag_plot_high_density.png differ
diff --git a/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_model_overview.ipynb b/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_model_overview.ipynb
index 0dba8397..18b68ce0 100644
--- a/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_model_overview.ipynb
+++ b/cities/deployment/tracts_minneapolis/tracts_model_overview/tracts_model_overview.ipynb
@@ -10,12 +10,12 @@
"source": [
"## What is this project about?\n",
"\n",
- "We use state-of-the-art bayesian causal models to investigate the role of parking zoning reform in Minneapolis on the development of new housing units, at a relatively fine-grained level of census tracts. Minneapolis is an example of a city which somewhat sucessfuly navigates the housing crisis, and a parking zoning reform has been claimed to be connected to this outcome (see for example [here](https://reason.com/2024/02/27/fear-loathing-and-zoning-reform-in-minnesota/) and [here](https://www.strongtowns.org/journal/2023/9/15/ending-minimum-parking-requirements-was-a-policy-win-for-the-twin-cities)).\n",
+ "We use state-of-the-art Bayesian causal modeling tools ([ChiRho](https://github.com/BasisResearch/chirho)) to investigate the role of parking zoning reform in Minneapolis on the development of new housing units, at a relatively fine-grained level of census tracts. Minneapolis is an example of a city which somewhat sucessfuly navigates the housing crisis, and a parking zoning reform has been claimed to be connected to this outcome (see for example [here](https://reason.com/2024/02/27/fear-loathing-and-zoning-reform-in-minnesota/) and [here](https://www.strongtowns.org/journal/2023/9/15/ending-minimum-parking-requirements-was-a-policy-win-for-the-twin-cities)).\n",
"\n",
"\n",
"%TODO Someone should perhaps check if there are better links to include here\n",
"\n",
- "It is quite clear that the number of housing units increased faster after the reform. What is not quite clear, is whether this is a mere correlation or not.We decided to take a deep dive and connect parcel-level data with demographic variables within a carefully devised causal model to investigate. \n"
+ "Whether this is so, to what extent and with what uncertainty has been unclear. Yes, the number of housing units in the city increased faster after the reform. But it is not ovious whether this isn't a mere correlation arising from other variables being causally responsible, or random variation. We decided to take a deep dive and connect detailed census tracts data with demographic variables within a carefully devised causal model to investigate. Due to data availability limitations, we start at year 2010. Since a major world-wide event changed too many things in 2020, this is where our data collection stops, to be able to separate the zoning concerns from the complex and unprecedented events that follow. It turns out that even with 10 years of data only, causal modelling allows us to offer some (admittedly, uncertain) answers."
]
},
{
@@ -24,10 +24,9 @@
"source": [
"## Why this is not a typical machine learning project\n",
"\n",
- "A typical predictive project in machine learning tends to use as much data as possible and uses algorithms to identify patters, focusing only on predictive accuracy. While such an approach is useful, the key limitation is that such models have a hard time distinguishing accidental correlations from causal connections, and therefore are not realiable guides to counterfactual predictions and causal effect evaluation. Moreover, a typical model often disregards information that humans use heavily: temporal or causal structures, which are needed to generalize well outside the training data.\n",
+ "A typical predictive project in machine learning tends to use as much data as possible and algorithms to identify patters, focusing only on predictive accuracy. While such an approach is useful, the key limitation is that such models have a hard time distinguishing accidental correlations from causal connections, and therefore are not realiable guides to counterfactual predictions and causal effect estimation. Moreover, a typical model often disregards information that humans use heavily: temporal, spatial or causal structures, which are needed to generalize well outside the training data.\n",
"\n",
- "Instead, we use our core open source technology, [ChiRho](https://github.com/BasisResearch/chirho) to build **bayesian causal** models using hand-picked relevant variables. This way, we work with humans and domain experts in the loop. The fact that we use Bayesian methods, allow for the injection of their deep understanding of the ecosystem, which can be work in symbiosis with the data, even if the latter is somewhat limited. The fact that the models is causal gives us a chance to try to draw conclusions about effects of intereventions, and quantify the uncertainties involved and be honest about them.\n",
- "\n"
+ "Instead, we use our core open source technology, [ChiRho](https://github.com/BasisResearch/chirho) to build **bayesian causal models** using hand-picked relevant variables. This way, we can work with humans and in the loop. The fact that we use Bayesian methods, allows for the injection of human understanding of the causal dependecies, which then are made work in symbiosis with the data, even if the latter is somewhat limited, and for honest assessment of the resulting uncertainties. The fact that the models is causal gives us a chance to address counterfactual queries involving alternative interventions.\n"
]
},
{
@@ -38,13 +37,14 @@
"\n",
"## Why care about different types of questions?\n",
"\n",
- "Once we start thinking in causal terms, there are **multiple types of queries** that we can distinguish and answer using the model, and such questions typically have different answers. \n",
+ "Once we start thinking in causal terms, there are **multiple types of queries** that we can distinguish and answer using the model, and such questions typically have different answers. While assosciative information is often useful or revealing, equally often we wwant to be able to evaluate potential consequences of acting one way or another, and in this mode of reflection, we rather turn to thinking in terms of interventions and counterfactuals.\n",
"\n",
"- *Association*. Example: Is there a correlation between increased green spaces and decreased crime rate in an area? Perhaps, areas with more green spaces do tend to have lower crime rates for various reasons.\n",
"\n",
- "- *Intervention* If the city implements a zoning change to create more green spaces, how would this impact the crime rate in the area? The answer might differ here: factors other than the policy change probably influence crime rates to a larger extent.\n",
+ "- *Intervention* If the city implements a zoning change to create more green spaces, how would this impact the crime rate in the area? The answer might differ here: factors other than the policy change probably influence crime rates to a large extent.\n",
+ "\n",
+ "- *Counterfactual* Suppose you did create more green spaces and the crime rate in the area did go down. Are you to be thanked? This depends on whether the crime rate would have gone down had you not created more green space in the area. Would it?\n",
"\n",
- "- *Counterfactual* Suppose you did create more green spaces and the crime rate in the area did go down. Are you to be thanked? This depends on whether the crime rate would have gone down had you not created more green space in the area.\n",
"\n",
"\n"
]
@@ -55,7 +55,7 @@
"source": [
"## Counterfactual modeling of the zoning reform\n",
"\n",
- "In the case at hand, we allow you, the user, to investigate predicted counterfactual outcomes of a zoning reform, specifed in terms of where the two zones start, what parking limits are to be imposed in different zones, and what year the reform has been introduced. The variables\n",
+ "In the case at hand, we allow you, the user, to investigate predicted counterfactual outcomes of a zoning reform, specifed in terms of where the two zones start, what parking limits are to be imposed in different zones, and what year the reform has been introduced. From among the available variables we hand-picked the ones that are most useful and meaningfully causally connected. The model simultaneously learns the strenghts of over 30 causal connections and uses this information to inform its counterfactual predictions. The structural assumptions we have made at a high level can be described by the diagram below. However, a moderately competent user can use our [open source codebase](https://github.com/BasisResearch/cities) to tweak or modify these assumptions and invesigate the consequences of doing so.\n",
" "
]
},
@@ -63,10 +63,17 @@
"cell_type": "markdown",
"metadata": {},
"source": [
- "\n",
- "\n",
"
\n"
]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## How does the model perform?\n",
+ "\n",
+ "The causal layer, nevertheless, should not take place at the cost of predictive power. The models went through a battery of tests on split data, each time being able to account for around 25-30% variation in the data (which for such noisy problems is fairly decent peformance), effectively on average improving predictions of new housing units appearing in each of census tracts at each of a given years by the count of 35-40 over a null model. A detailed notebook with model testing is also available at our open source codebase. "
+ ]
}
],
"metadata": {
diff --git a/cities/deployment/tracts_minneapolis/train_model.py b/cities/deployment/tracts_minneapolis/train_model.py
index 3bffe537..7b63204c 100644
--- a/cities/deployment/tracts_minneapolis/train_model.py
+++ b/cities/deployment/tracts_minneapolis/train_model.py
@@ -8,9 +8,16 @@
from dotenv import load_dotenv
from cities.modeling.svi_inference import run_svi_inference
-from cities.modeling.zoning_models.zoning_tracts_model import TractsModel
+
+# from cities.modeling.zoning_models.zoning_tracts_model import TractsModel
+from cities.modeling.zoning_models.zoning_tracts_sqm_model import (
+ TractsModelSqm as TractsModel,
+)
+from cities.utils.data_grabber import find_repo_root
from cities.utils.data_loader import select_from_sql
+n_steps = 2000
+
load_dotenv()
@@ -34,6 +41,7 @@
"income",
"segregation_original",
"white_original",
+ "parcel_sqm",
},
"outcome": "housing_units",
}
@@ -64,15 +72,21 @@
pyro.clear_param_store()
-guide = run_svi_inference(tracts_model, n_steps=2000, lr=0.03, plot=False, **subset)
+guide = run_svi_inference(tracts_model, n_steps=n_steps, lr=0.03, plot=False, **subset)
##########################################
# save guide and params in the same folder
##########################################
+root = find_repo_root()
+
+deploy_path = os.path.join(root, "cities/deployment/tracts_minneapolis")
+guide_path = os.path.join(deploy_path, "tracts_model_guide.pkl")
+param_path = os.path.join(deploy_path, "tracts_model_params.pth")
+
+guide_path = os.path.join(deploy_path, "tracts_model_guide.pkl")
serialized_guide = dill.dumps(guide)
-file_path = "tracts_model_guide.pkl"
-with open(file_path, "wb") as file:
+with open(guide_path, "wb") as file:
file.write(serialized_guide)
-param_path = "tracts_model_params.pth"
-pyro.get_param_store().save(param_path)
+with open(param_path, "wb") as file:
+ pyro.get_param_store().save(param_path)
diff --git a/cities/queries/causal_insight_slim.py b/cities/queries/causal_insight_slim.py
index a7ebc3b4..3efc6d09 100644
--- a/cities/queries/causal_insight_slim.py
+++ b/cities/queries/causal_insight_slim.py
@@ -6,7 +6,7 @@
import plotly.graph_objects as go
from sklearn.preprocessing import StandardScaler
-from cities.utils.cleaning_scripts.cleaning_utils import (
+from cities.utils.cleaning_utils import (
revert_prediction_df,
revert_standardize_and_scale_scaler,
sigmoid,
diff --git a/data/minneapolis/processed/pg_census_tracts_dataset.pt b/data/minneapolis/processed/pg_census_tracts_dataset.pt
index a79be96c..168008a7 100644
Binary files a/data/minneapolis/processed/pg_census_tracts_dataset.pt and b/data/minneapolis/processed/pg_census_tracts_dataset.pt differ
diff --git a/docs/experimental_notebooks/zoning/tracts_dag_plot.pdf b/docs/experimental_notebooks/zoning/tracts_dag_plot.pdf
index 12b1988f..9cda2e15 100644
Binary files a/docs/experimental_notebooks/zoning/tracts_dag_plot.pdf and b/docs/experimental_notebooks/zoning/tracts_dag_plot.pdf differ
diff --git a/docs/experimental_notebooks/zoning/tracts_dag_plot_high_density.png b/docs/experimental_notebooks/zoning/tracts_dag_plot_high_density.png
index a3e337a5..e6e5f6cc 100644
Binary files a/docs/experimental_notebooks/zoning/tracts_dag_plot_high_density.png and b/docs/experimental_notebooks/zoning/tracts_dag_plot_high_density.png differ
diff --git a/docs/experimental_notebooks/zoning/tracts_dags.R b/docs/experimental_notebooks/zoning/tracts_dags.R
index ebf38639..104e3944 100644
--- a/docs/experimental_notebooks/zoning/tracts_dags.R
+++ b/docs/experimental_notebooks/zoning/tracts_dags.R
@@ -11,32 +11,64 @@ print(getwd())
tracts_dag <- dagitty('dag {
year [pos="0,2"]
distance [pos = "0,0"]
- total_value [pos = "1,0"]
- median_value [pos = "1.2,0.3"]
- limit [pos="1,1"]
- units [pos = "2,1"]
- distance -> limit
- distance -> total_value
- distance -> median_value
- distance -> units
+ square_meters [pos = "0.2,.4"]
+ limit [pos = "0.2, 1.6"]
+
+ white [pos = "0.4,1.8"]
+ segregation [pos = "0.6,0.2"]
+
+ income [pos = "0.7, .8"]
+
+ median_value [pos = "0.9,1.4"]
+ housing_units [pos = "1.,.6"]
+ distance -> square_meters
+ year -> square_meters
+
+ distance -> limit
year -> limit
- year -> total_value
- year -> median_value
- year -> units
- total_value -> units
- median_value -> units
+ distance -> white
+ square_meters -> white
+ limit -> white
+
+ distance -> segregation
+ year -> segregation
+ limit -> segregation
+ square_meters -> segregation
+ white -> segregation
+ distance -> income
+ white -> income
+ segregation -> income
+ square_meters -> income
+ limit -> income
+ year -> income
- limit -> total_value
+ distance -> median_value
+ income -> median_value
+ white -> median_value
+ segregation -> median_value
+ square_meters -> median_value
limit -> median_value
- limit -> units
+ year -> median_value
+
+ median_value -> housing_units
+ distance -> housing_units
+ income -> housing_units
+ white -> housing_units
+ limit -> housing_units
+ segregation -> housing_units
+ square_meters -> housing_units
+ year -> housing_units
+
+
+
}')
-
+plot(tracts_dag)
png("tracts_dag_plot_high_density.png",
@@ -58,6 +90,6 @@ plot(tracts_dag)
dev.off()
plot(tracts_dag)
-paths(tracts_dag,"limit","units")
-adjustmentSets(tracts_dag,"limit","units", type = "all")
+paths(tracts_dag,"limit","housing_units")
+adjustmentSets(tracts_dag,"limit","housing_units", type = "all")
impliedConditionalIndependencies(tracts_dag)
diff --git a/docs/experimental_notebooks/zoning/zoning_new_data_pipeline.ipynb b/docs/experimental_notebooks/zoning/zoning_new_data_pipeline.ipynb
index 8b333baf..b6e506e9 100644
--- a/docs/experimental_notebooks/zoning/zoning_new_data_pipeline.ipynb
+++ b/docs/experimental_notebooks/zoning/zoning_new_data_pipeline.ipynb
@@ -73,7 +73,7 @@
},
{
"cell_type": "code",
- "execution_count": 15,
+ "execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@@ -81,40 +81,82 @@
"HOST = os.getenv(\"HOST\")\n",
"DATABASE = os.getenv(\"DATABASE\")\n",
"\n",
- "new_kwargs = {}\n",
- "new_kwargs['categorical'] = old_data['categorical'].keys()\n",
- "new_kwargs['continuous'] = set(old_data['continuous'].keys())\n",
- "new_kwargs['outcome'] = \"housing_units\""
+ "new_kwargs = {\n",
+ " \"categorical\": [\"year\", \"census_tract\"],\n",
+ " \"continuous\": {\n",
+ " \"housing_units\",\n",
+ " \"total_value\",\n",
+ " \"median_value\",\n",
+ " \"mean_limit_original\",\n",
+ " \"median_distance\",\n",
+ " \"income\",\n",
+ " \"segregation_original\",\n",
+ " \"white_original\",\n",
+ " \"parcel_sqm\"\n",
+ " },\n",
+ " \"outcome\": \"housing_units\",\n",
+ "}"
]
},
{
"cell_type": "code",
- "execution_count": 18,
- "metadata": {},
- "outputs": [],
- "source": [
- "# parcel_sqm, parcel_mean_sqm, and parcel_median_sqm columns\n",
- "\n",
- "new_kwargs['continuous'].add('parcel_sqm')"
- ]
- },
- {
- "cell_type": "code",
- "execution_count": 19,
+ "execution_count": 4,
"metadata": {},
"outputs": [
{
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "Data loaded in 0.9300844669342041 seconds\n"
+ "ename": "OperationalError",
+ "evalue": "(psycopg2.OperationalError) connection to server at \"34.123.100.76\", port 5432 failed: fe_sendauth: no password supplied\n\n(Background on this error at: https://sqlalche.me/e/20/e3q8)",
+ "output_type": "error",
+ "traceback": [
+ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
+ "\u001b[0;31mOperationalError\u001b[0m Traceback (most recent call last)",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:145\u001b[0m, in \u001b[0;36mConnection.__init__\u001b[0;34m(self, engine, connection, _has_events, _allow_revalidate, _allow_autobegin)\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_dbapi_connection \u001b[38;5;241m=\u001b[39m \u001b[43mengine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraw_connection\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 146\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m dialect\u001b[38;5;241m.\u001b[39mloaded_dbapi\u001b[38;5;241m.\u001b[39mError \u001b[38;5;28;01mas\u001b[39;00m err:\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:3303\u001b[0m, in \u001b[0;36mEngine.raw_connection\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 3282\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Return a \"raw\" DBAPI connection from the connection pool.\u001b[39;00m\n\u001b[1;32m 3283\u001b[0m \n\u001b[1;32m 3284\u001b[0m \u001b[38;5;124;03mThe returned object is a proxied version of the DBAPI\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3301\u001b[0m \n\u001b[1;32m 3302\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m-> 3303\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:449\u001b[0m, in \u001b[0;36mPool.connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 442\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Return a DBAPI connection from the pool.\u001b[39;00m\n\u001b[1;32m 443\u001b[0m \n\u001b[1;32m 444\u001b[0m \u001b[38;5;124;03mThe connection is instrumented such that when its\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 447\u001b[0m \n\u001b[1;32m 448\u001b[0m \u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m--> 449\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_ConnectionFairy\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_checkout\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:1263\u001b[0m, in \u001b[0;36m_ConnectionFairy._checkout\u001b[0;34m(cls, pool, threadconns, fairy)\u001b[0m\n\u001b[1;32m 1262\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m fairy:\n\u001b[0;32m-> 1263\u001b[0m fairy \u001b[38;5;241m=\u001b[39m \u001b[43m_ConnectionRecord\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheckout\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpool\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1265\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m threadconns \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:712\u001b[0m, in \u001b[0;36m_ConnectionRecord.checkout\u001b[0;34m(cls, pool)\u001b[0m\n\u001b[1;32m 711\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 712\u001b[0m rec \u001b[38;5;241m=\u001b[39m \u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_do_get\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 714\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py:179\u001b[0m, in \u001b[0;36mQueuePool._do_get\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 178\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[0;32m--> 179\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m util\u001b[38;5;241m.\u001b[39msafe_reraise():\n\u001b[1;32m 180\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_dec_overflow()\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py:146\u001b[0m, in \u001b[0;36msafe_reraise.__exit__\u001b[0;34m(self, type_, value, traceback)\u001b[0m\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n\u001b[0;32m--> 146\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc_value\u001b[38;5;241m.\u001b[39mwith_traceback(exc_tb)\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py:177\u001b[0m, in \u001b[0;36mQueuePool._do_get\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 176\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 177\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_create_connection\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:390\u001b[0m, in \u001b[0;36mPool._create_connection\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 388\u001b[0m \u001b[38;5;250m\u001b[39m\u001b[38;5;124;03m\"\"\"Called by subclasses to create a new ConnectionRecord.\"\"\"\u001b[39;00m\n\u001b[0;32m--> 390\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_ConnectionRecord\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:674\u001b[0m, in \u001b[0;36m_ConnectionRecord.__init__\u001b[0;34m(self, pool, connect)\u001b[0m\n\u001b[1;32m 673\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m connect:\n\u001b[0;32m--> 674\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__connect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 675\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfinalize_callback \u001b[38;5;241m=\u001b[39m deque()\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:900\u001b[0m, in \u001b[0;36m_ConnectionRecord.__connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 899\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 900\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m util\u001b[38;5;241m.\u001b[39msafe_reraise():\n\u001b[1;32m 901\u001b[0m pool\u001b[38;5;241m.\u001b[39mlogger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mError on connect(): \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, e)\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py:146\u001b[0m, in \u001b[0;36msafe_reraise.__exit__\u001b[0;34m(self, type_, value, traceback)\u001b[0m\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n\u001b[0;32m--> 146\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc_value\u001b[38;5;241m.\u001b[39mwith_traceback(exc_tb)\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:896\u001b[0m, in \u001b[0;36m_ConnectionRecord.__connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 895\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstarttime \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[0;32m--> 896\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdbapi_connection \u001b[38;5;241m=\u001b[39m connection \u001b[38;5;241m=\u001b[39m \u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_invoke_creator\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 897\u001b[0m pool\u001b[38;5;241m.\u001b[39mlogger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCreated new connection \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, connection)\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/create.py:643\u001b[0m, in \u001b[0;36mcreate_engine..connect\u001b[0;34m(connection_record)\u001b[0m\n\u001b[1;32m 641\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m connection\n\u001b[0;32m--> 643\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdialect\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcparams\u001b[49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/default.py:616\u001b[0m, in \u001b[0;36mDefaultDialect.connect\u001b[0;34m(self, *cargs, **cparams)\u001b[0m\n\u001b[1;32m 614\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mconnect\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39mcargs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mcparams):\n\u001b[1;32m 615\u001b[0m \u001b[38;5;66;03m# inherits the docstring from interfaces.Dialect.connect\u001b[39;00m\n\u001b[0;32m--> 616\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloaded_dbapi\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcparams\u001b[49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/miniconda3/envs/polis-dev/lib/python3.10/site-packages/psycopg2/__init__.py:122\u001b[0m, in \u001b[0;36mconnect\u001b[0;34m(dsn, connection_factory, cursor_factory, **kwargs)\u001b[0m\n\u001b[1;32m 121\u001b[0m dsn \u001b[38;5;241m=\u001b[39m _ext\u001b[38;5;241m.\u001b[39mmake_dsn(dsn, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m--> 122\u001b[0m conn \u001b[38;5;241m=\u001b[39m \u001b[43m_connect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdsn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconnection_factory\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconnection_factory\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwasync\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 123\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cursor_factory \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n",
+ "\u001b[0;31mOperationalError\u001b[0m: connection to server at \"34.123.100.76\", port 5432 failed: fe_sendauth: no password supplied\n",
+ "\nThe above exception was the direct cause of the following exception:\n",
+ "\u001b[0;31mOperationalError\u001b[0m Traceback (most recent call last)",
+ "Cell \u001b[0;32mIn[4], line 4\u001b[0m\n\u001b[1;32m 1\u001b[0m load_start \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[1;32m 2\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m \u001b[43msqlalchemy\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcreate_engine\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 3\u001b[0m \u001b[43m \u001b[49m\u001b[38;5;124;43mf\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mpostgresql://\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mUSERNAME\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m@\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mHOST\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m/\u001b[39;49m\u001b[38;5;132;43;01m{\u001b[39;49;00m\u001b[43mDATABASE\u001b[49m\u001b[38;5;132;43;01m}\u001b[39;49;00m\u001b[38;5;124;43m\"\u001b[39;49m\n\u001b[0;32m----> 4\u001b[0m \u001b[43m)\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m \u001b[38;5;28;01mas\u001b[39;00m conn:\n\u001b[1;32m 5\u001b[0m new_data \u001b[38;5;241m=\u001b[39m select_from_sql(\n\u001b[1;32m 6\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mselect * from dev.tracts_model__census_tracts order by census_tract, year\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[1;32m 7\u001b[0m conn,\n\u001b[1;32m 8\u001b[0m new_kwargs,\n\u001b[1;32m 9\u001b[0m )\n\u001b[1;32m 10\u001b[0m load_end \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:3279\u001b[0m, in \u001b[0;36mEngine.connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 3256\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mconnect\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m Connection:\n\u001b[1;32m 3257\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Return a new :class:`_engine.Connection` object.\u001b[39;00m\n\u001b[1;32m 3258\u001b[0m \n\u001b[1;32m 3259\u001b[0m \u001b[38;5;124;03m The :class:`_engine.Connection` acts as a Python context manager, so\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3276\u001b[0m \n\u001b[1;32m 3277\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 3279\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_connection_cls\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:147\u001b[0m, in \u001b[0;36mConnection.__init__\u001b[0;34m(self, engine, connection, _has_events, _allow_revalidate, _allow_autobegin)\u001b[0m\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_dbapi_connection \u001b[38;5;241m=\u001b[39m engine\u001b[38;5;241m.\u001b[39mraw_connection()\n\u001b[1;32m 146\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m dialect\u001b[38;5;241m.\u001b[39mloaded_dbapi\u001b[38;5;241m.\u001b[39mError \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[0;32m--> 147\u001b[0m \u001b[43mConnection\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_handle_dbapi_exception_noconnection\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m 148\u001b[0m \u001b[43m \u001b[49m\u001b[43merr\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdialect\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mengine\u001b[49m\n\u001b[1;32m 149\u001b[0m \u001b[43m \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 150\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n\u001b[1;32m 151\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:2443\u001b[0m, in \u001b[0;36mConnection._handle_dbapi_exception_noconnection\u001b[0;34m(cls, e, dialect, engine, is_disconnect, invalidate_pool_on_disconnect, is_pre_ping)\u001b[0m\n\u001b[1;32m 2441\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m should_wrap:\n\u001b[1;32m 2442\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m sqlalchemy_exception \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m-> 2443\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m sqlalchemy_exception\u001b[38;5;241m.\u001b[39mwith_traceback(exc_info[\u001b[38;5;241m2\u001b[39m]) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;21;01me\u001b[39;00m\n\u001b[1;32m 2444\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 2445\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m exc_info[\u001b[38;5;241m1\u001b[39m] \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:145\u001b[0m, in \u001b[0;36mConnection.__init__\u001b[0;34m(self, engine, connection, _has_events, _allow_revalidate, _allow_autobegin)\u001b[0m\n\u001b[1;32m 143\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m connection \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_dbapi_connection \u001b[38;5;241m=\u001b[39m \u001b[43mengine\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mraw_connection\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 146\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m dialect\u001b[38;5;241m.\u001b[39mloaded_dbapi\u001b[38;5;241m.\u001b[39mError \u001b[38;5;28;01mas\u001b[39;00m err:\n\u001b[1;32m 147\u001b[0m Connection\u001b[38;5;241m.\u001b[39m_handle_dbapi_exception_noconnection(\n\u001b[1;32m 148\u001b[0m err, dialect, engine\n\u001b[1;32m 149\u001b[0m )\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/base.py:3303\u001b[0m, in \u001b[0;36mEngine.raw_connection\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 3281\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mraw_connection\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m PoolProxiedConnection:\n\u001b[1;32m 3282\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Return a \"raw\" DBAPI connection from the connection pool.\u001b[39;00m\n\u001b[1;32m 3283\u001b[0m \n\u001b[1;32m 3284\u001b[0m \u001b[38;5;124;03m The returned object is a proxied version of the DBAPI\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3301\u001b[0m \n\u001b[1;32m 3302\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 3303\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:449\u001b[0m, in \u001b[0;36mPool.connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 441\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mconnect\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m PoolProxiedConnection:\n\u001b[1;32m 442\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Return a DBAPI connection from the pool.\u001b[39;00m\n\u001b[1;32m 443\u001b[0m \n\u001b[1;32m 444\u001b[0m \u001b[38;5;124;03m The connection is instrumented such that when its\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 447\u001b[0m \n\u001b[1;32m 448\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 449\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_ConnectionFairy\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_checkout\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:1263\u001b[0m, in \u001b[0;36m_ConnectionFairy._checkout\u001b[0;34m(cls, pool, threadconns, fairy)\u001b[0m\n\u001b[1;32m 1255\u001b[0m \u001b[38;5;129m@classmethod\u001b[39m\n\u001b[1;32m 1256\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_checkout\u001b[39m(\n\u001b[1;32m 1257\u001b[0m \u001b[38;5;28mcls\u001b[39m,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 1260\u001b[0m fairy: Optional[_ConnectionFairy] \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[1;32m 1261\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m _ConnectionFairy:\n\u001b[1;32m 1262\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m fairy:\n\u001b[0;32m-> 1263\u001b[0m fairy \u001b[38;5;241m=\u001b[39m \u001b[43m_ConnectionRecord\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mcheckout\u001b[49m\u001b[43m(\u001b[49m\u001b[43mpool\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 1265\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m threadconns \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 1266\u001b[0m threadconns\u001b[38;5;241m.\u001b[39mcurrent \u001b[38;5;241m=\u001b[39m weakref\u001b[38;5;241m.\u001b[39mref(fairy)\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:712\u001b[0m, in \u001b[0;36m_ConnectionRecord.checkout\u001b[0;34m(cls, pool)\u001b[0m\n\u001b[1;32m 710\u001b[0m rec \u001b[38;5;241m=\u001b[39m cast(_ConnectionRecord, pool\u001b[38;5;241m.\u001b[39m_do_get())\n\u001b[1;32m 711\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m--> 712\u001b[0m rec \u001b[38;5;241m=\u001b[39m \u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_do_get\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 714\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 715\u001b[0m dbapi_connection \u001b[38;5;241m=\u001b[39m rec\u001b[38;5;241m.\u001b[39mget_connection()\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py:179\u001b[0m, in \u001b[0;36mQueuePool._do_get\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 177\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_create_connection()\n\u001b[1;32m 178\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[0;32m--> 179\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m util\u001b[38;5;241m.\u001b[39msafe_reraise():\n\u001b[1;32m 180\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_dec_overflow()\n\u001b[1;32m 181\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py:146\u001b[0m, in \u001b[0;36msafe_reraise.__exit__\u001b[0;34m(self, type_, value, traceback)\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m exc_value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n\u001b[0;32m--> 146\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc_value\u001b[38;5;241m.\u001b[39mwith_traceback(exc_tb)\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/impl.py:177\u001b[0m, in \u001b[0;36mQueuePool._do_get\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 175\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_inc_overflow():\n\u001b[1;32m 176\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m--> 177\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_create_connection\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 178\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m:\n\u001b[1;32m 179\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m util\u001b[38;5;241m.\u001b[39msafe_reraise():\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:390\u001b[0m, in \u001b[0;36mPool._create_connection\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 387\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21m_create_connection\u001b[39m(\u001b[38;5;28mself\u001b[39m) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ConnectionPoolEntry:\n\u001b[1;32m 388\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"Called by subclasses to create a new ConnectionRecord.\"\"\"\u001b[39;00m\n\u001b[0;32m--> 390\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43m_ConnectionRecord\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:674\u001b[0m, in \u001b[0;36m_ConnectionRecord.__init__\u001b[0;34m(self, pool, connect)\u001b[0m\n\u001b[1;32m 672\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m__pool \u001b[38;5;241m=\u001b[39m pool\n\u001b[1;32m 673\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m connect:\n\u001b[0;32m--> 674\u001b[0m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m__connect\u001b[49m\u001b[43m(\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 675\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfinalize_callback \u001b[38;5;241m=\u001b[39m deque()\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:900\u001b[0m, in \u001b[0;36m_ConnectionRecord.__connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 898\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfresh \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n\u001b[1;32m 899\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m--> 900\u001b[0m \u001b[38;5;28;01mwith\u001b[39;00m util\u001b[38;5;241m.\u001b[39msafe_reraise():\n\u001b[1;32m 901\u001b[0m pool\u001b[38;5;241m.\u001b[39mlogger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mError on connect(): \u001b[39m\u001b[38;5;132;01m%s\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, e)\n\u001b[1;32m 902\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 903\u001b[0m \u001b[38;5;66;03m# in SQLAlchemy 1.4 the first_connect event is not used by\u001b[39;00m\n\u001b[1;32m 904\u001b[0m \u001b[38;5;66;03m# the engine, so this will usually not be set\u001b[39;00m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/util/langhelpers.py:146\u001b[0m, in \u001b[0;36msafe_reraise.__exit__\u001b[0;34m(self, type_, value, traceback)\u001b[0m\n\u001b[1;32m 144\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m exc_value \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[1;32m 145\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n\u001b[0;32m--> 146\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m exc_value\u001b[38;5;241m.\u001b[39mwith_traceback(exc_tb)\n\u001b[1;32m 147\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m 148\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_exc_info \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;66;03m# remove potential circular references\u001b[39;00m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/pool/base.py:896\u001b[0m, in \u001b[0;36m_ConnectionRecord.__connect\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 894\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[1;32m 895\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mstarttime \u001b[38;5;241m=\u001b[39m time\u001b[38;5;241m.\u001b[39mtime()\n\u001b[0;32m--> 896\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mdbapi_connection \u001b[38;5;241m=\u001b[39m connection \u001b[38;5;241m=\u001b[39m \u001b[43mpool\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43m_invoke_creator\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m)\u001b[49m\n\u001b[1;32m 897\u001b[0m pool\u001b[38;5;241m.\u001b[39mlogger\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mCreated new connection \u001b[39m\u001b[38;5;132;01m%r\u001b[39;00m\u001b[38;5;124m\"\u001b[39m, connection)\n\u001b[1;32m 898\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mfresh \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mTrue\u001b[39;00m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/create.py:643\u001b[0m, in \u001b[0;36mcreate_engine..connect\u001b[0;34m(connection_record)\u001b[0m\n\u001b[1;32m 640\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m connection \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 641\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m connection\n\u001b[0;32m--> 643\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mdialect\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcparams\u001b[49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/.local/lib/python3.10/site-packages/sqlalchemy/engine/default.py:616\u001b[0m, in \u001b[0;36mDefaultDialect.connect\u001b[0;34m(self, *cargs, **cparams)\u001b[0m\n\u001b[1;32m 614\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mconnect\u001b[39m(\u001b[38;5;28mself\u001b[39m, \u001b[38;5;241m*\u001b[39mcargs, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mcparams):\n\u001b[1;32m 615\u001b[0m \u001b[38;5;66;03m# inherits the docstring from interfaces.Dialect.connect\u001b[39;00m\n\u001b[0;32m--> 616\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mloaded_dbapi\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mconnect\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcargs\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcparams\u001b[49m\u001b[43m)\u001b[49m\n",
+ "File \u001b[0;32m~/miniconda3/envs/polis-dev/lib/python3.10/site-packages/psycopg2/__init__.py:122\u001b[0m, in \u001b[0;36mconnect\u001b[0;34m(dsn, connection_factory, cursor_factory, **kwargs)\u001b[0m\n\u001b[1;32m 119\u001b[0m kwasync[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124masync_\u001b[39m\u001b[38;5;124m'\u001b[39m] \u001b[38;5;241m=\u001b[39m kwargs\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m'\u001b[39m\u001b[38;5;124masync_\u001b[39m\u001b[38;5;124m'\u001b[39m)\n\u001b[1;32m 121\u001b[0m dsn \u001b[38;5;241m=\u001b[39m _ext\u001b[38;5;241m.\u001b[39mmake_dsn(dsn, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n\u001b[0;32m--> 122\u001b[0m conn \u001b[38;5;241m=\u001b[39m \u001b[43m_connect\u001b[49m\u001b[43m(\u001b[49m\u001b[43mdsn\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mconnection_factory\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mconnection_factory\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mkwasync\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m 123\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m cursor_factory \u001b[38;5;129;01mis\u001b[39;00m \u001b[38;5;129;01mnot\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m:\n\u001b[1;32m 124\u001b[0m conn\u001b[38;5;241m.\u001b[39mcursor_factory \u001b[38;5;241m=\u001b[39m cursor_factory\n",
+ "\u001b[0;31mOperationalError\u001b[0m: (psycopg2.OperationalError) connection to server at \"34.123.100.76\", port 5432 failed: fe_sendauth: no password supplied\n\n(Background on this error at: https://sqlalche.me/e/20/e3q8)"
]
}
],
"source": [
"load_start = time.time()\n",
"with sqlalchemy.create_engine(\n",
- " f\"postgresql://{USERNAME}@{HOST}/{DATABASE}\"\n",
+ " f\"postgresql://{USERNAME}:{PASSWORD}@{HOST}/{DATABASE}\"\n",
").connect() as conn:\n",
" new_data = select_from_sql(\n",
" \"select * from dev.tracts_model__census_tracts order by census_tract, year\",\n",
@@ -127,7 +169,7 @@
},
{
"cell_type": "code",
- "execution_count": 37,
+ "execution_count": null,
"metadata": {},
"outputs": [
{
@@ -163,7 +205,7 @@
},
{
"cell_type": "code",
- "execution_count": 5,
+ "execution_count": null,
"metadata": {},
"outputs": [
{
@@ -369,7 +411,7 @@
},
{
"cell_type": "code",
- "execution_count": 6,
+ "execution_count": null,
"metadata": {},
"outputs": [
{
@@ -414,7 +456,7 @@
},
{
"cell_type": "code",
- "execution_count": 7,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -434,7 +476,7 @@
},
{
"cell_type": "code",
- "execution_count": 8,
+ "execution_count": null,
"metadata": {},
"outputs": [
{
@@ -460,7 +502,7 @@
},
{
"cell_type": "code",
- "execution_count": 11,
+ "execution_count": null,
"metadata": {},
"outputs": [],
"source": [
@@ -469,6 +511,9 @@
" new_data['categorical'], new_data['continuous'], standardization_dictionary=new_standardization_dict\n",
")\n",
"\n",
+ "\n",
+ "assert \"parcel_sqm\" in new_data['continuous'].keys()\n",
+ "\n",
"pg_census_tracts_loader = DataLoader(pg_census_tracts_dataset, batch_size=len(pg_census_tracts_dataset), shuffle=True)\n",
"\n",
"pg_census_tracts_data_path = os.path.join(\n",
diff --git a/scripts/grab.sh b/scripts/grab.sh
new file mode 100755
index 00000000..fe0e2234
--- /dev/null
+++ b/scripts/grab.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+# This is a convenience script
+# to source the .env_pw file from home
+# if you have it
+
+cd ~
+
+if [ -f .env_pw ]; then
+ echo ".env_pw found, sourcing..."
+
+ source .env_pw
+
+ if [ -z "$PASSWORD" ]; then
+ echo "PASSWORD variable is not set."
+ else
+ echo "Sourced .env_pw successfully."
+ echo "Password: $PASSWORD"
+ fi
+else
+ echo ".env_pw not found in the home directory."
+fi