Skip to content

Commit

Permalink
fix secrets API for 4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
jimdowling committed Dec 12, 2024
1 parent d2a8292 commit 0d92a90
Show file tree
Hide file tree
Showing 14 changed files with 53 additions and 4,157 deletions.
2 changes: 1 addition & 1 deletion notebooks/ch03/1_air_quality_feature_backfill.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
}
],
"source": [
"secrets = util.secrets_api(project.name)\n",
"secrets = hopsworks.get_secrets_api()\n",
"try:\n",
" secrets.create_secret(\"AQI_API_KEY\", AQI_API_KEY)\n",
"except hopsworks.RestAPIError:\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/ch03/2_air_quality_feature_pipeline.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"\n",
"project = hopsworks.login()\n",
"fs = project.get_feature_store() \n",
"secrets = util.secrets_api(project.name)\n",
"secrets = hopsworks.get_secrets_api()\n",
"\n",
"# This line will fail if you have not registered the AQI_API_KEY as a secret in Hopsworks\n",
"AQI_API_KEY = secrets.get_secret(\"AQI_API_KEY\").value\n",
Expand Down
108 changes: 50 additions & 58 deletions notebooks/ch03/3_air_quality_training_pipeline.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notebooks/ch03/4_air_quality_batch_inference.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"project = hopsworks.login()\n",
"fs = project.get_feature_store() \n",
"\n",
"secrets = util.secrets_api(project.name)\n",
"secrets = hopsworks.get_secrets_api()\n",
"location_str = secrets.get_secret(\"SENSOR_LOCATION_JSON\").value\n",
"location = json.loads(location_str)\n",
"country=location['country']\n",
Expand Down
8 changes: 0 additions & 8 deletions notebooks/ch03/functions/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,6 @@ def purge_project(proj):
delete_models(mr, "air_quality_xgboost_model")
delete_secrets(proj, "SENSOR_LOCATION_JSON")


def secrets_api(proj):
host = "c.app.hopsworks.ai"
api_key = os.environ.get('HOPSWORKS_API_KEY')
conn = hopsworks.connection(host=host, project=proj, api_key_value=api_key)
return conn.get_secrets_api()


def check_file_path(file_path):
my_file = Path(file_path)
if my_file.is_file() == False:
Expand Down

This file was deleted.

83 changes: 0 additions & 83 deletions notebooks/ch06/cc-fraud/feature-pipeline/features/transactions.py

This file was deleted.

Loading

0 comments on commit 0d92a90

Please sign in to comment.