Skip to content

Commit 6f9cc76

Browse files
committed
Developing DS Code
1 parent 7aeb755 commit 6f9cc76

File tree

7 files changed

+23
-19
lines changed

7 files changed

+23
-19
lines changed

data_science/src_nyc_taxi/registration/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Databricks notebook source
22

3-
3+
from databricks.sdk.runtime import *
44
from databricks import feature_store
55
from pyspark.sql.types import *
66
from pyspark.sql.functions import *

data_science/src_nyc_taxi/training/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#dbutils.library.restartPython()
1010
# COMMAND ----------
11-
11+
from databricks.sdk.runtime import *
1212
import os
1313
from sklearn import metrics
1414
import joblib
@@ -38,6 +38,7 @@
3838
from ds_utils import * # Custom Package
3939
import base64
4040
import datetime
41+
from pyspark.dbutils import DBUtils
4142

4243

4344
# COMMAND ----------
@@ -114,6 +115,10 @@ def get_secret(scope: str, secret_name: str) -> str:
114115

115116
if os.environ.get(secret_name):
116117
return os.environ.get(secret_name)
118+
119+
from pyspark.dbutils import DBUtils
120+
spark = SparkSession.builder.getOrCreate()
121+
dbutils = DBUtils(spark)
117122
return dbutils.secrets.get(scope=scope, key=secret_name)
118123

119124
def databricks_sdk_secrets(scope, secret_name):
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
# Databricks notebook source
22

3-
#from featurization import run_feature_store_refresh
4-
%run /Users/admin@mngenvmcap557827.onmicrosoft.com/.ide/dev/data_science/src_nyc_taxi/featurization/__init__
5-
# COMMAND ----------
6-
3+
from featurization import run_feature_store_refresh
74
run_feature_store_refresh()
85

96
# COMMAND ----------
107
from training import run_training
11-
%run /Users/admin@mngenvmcap557827.onmicrosoft.com/.ide/dev3/data_science/src_nyc_taxi/featurization/__init__
12-
# COMMAND ----------
13-
8+
from databricks.sdk.runtime import *
149
run_training(
1510
experiment_name = "ciaran_experiment_nyc_taxi",
1611
model_name = "taxi_example_fare_packaged",
@@ -26,5 +21,9 @@
2621
"seed": 42
2722
}
2823
)
29-
30-
# COMMAND ----------
24+
# COMMAND ----------
25+
from databricks.sdk.runtime import *
26+
from registration import run_registration
27+
run_registration(
28+
model_name = "taxi_example_fare_packaged"
29+
)

infrastructure/bicep/params/development/bicep.parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"contentVersion": "1.0.0.0",
44
"parameters": {
55
"TemplateParamFilePath": {
6-
"value": "mlOps/devOps/infra/master_templates/params/development/bicep.parameters.json"
6+
"value": "infrastructure/bicep/params/development/bicep.parameters.json"
77
},
88
"TemplateFilePath": {
9-
"value": "mlOps/devOps/infra/master_templates/main.bicep"
9+
"value": "infrastructure/bicep/main.bicep"
1010
},
1111
"AZURE_DATABRICKS_APP_ID": {
1212
"value": "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d"

infrastructure/bicep/params/production/bicep.parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"contentVersion": "1.0.0.0",
44
"parameters": {
55
"TemplateParamFilePath": {
6-
"value": "mlOps/devOps/infra/master_templates/params/production/bicep.parameters.json"
6+
"value": "infrastructure/bicep/params/production/bicep.parameters.json"
77
},
88
"TemplateFilePath": {
9-
"value": "mlOps/devOps/infra/master_templates/main.bicep"
9+
"value": "infrastructure/bicep/main.bicep"
1010
},
1111
"AZURE_DATABRICKS_APP_ID": {
1212
"value": "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d"

infrastructure/bicep/params/sandbox/bicep.parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"contentVersion": "1.0.0.0",
44
"parameters": {
55
"TemplateParamFilePath": {
6-
"value": "mlOps/devOps/infra/master_templates/params/sandbox/bicep.parameters.json"
6+
"value": "infrastructure/bicep/params/sandbox/bicep.parameters.json"
77
},
88
"TemplateFilePath": {
9-
"value": "mlOps/devOps/infra/master_templates/main.bicep"
9+
"value": "infrastructure/bicep/main.bicep"
1010
},
1111
"AZURE_DATABRICKS_APP_ID": {
1212
"value": "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d"

infrastructure/bicep/params/uat/bicep.parameters.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
"contentVersion": "1.0.0.0",
44
"parameters": {
55
"TemplateParamFilePath": {
6-
"value": "mlOps/devOps/infra/master_templates/params/uat/bicep.parameters.json"
6+
"value": "infrastructure/bicep/params/uat/bicep.parameters.json"
77
},
88
"TemplateFilePath": {
9-
"value": "mlOps/devOps/infra/master_templates/main.bicep"
9+
"value": "infrastructure/bicep/main.bicep"
1010
},
1111
"AZURE_DATABRICKS_APP_ID": {
1212
"value": "2ff814a6-3304-4ab8-85cb-cd0e6f879c1d"

0 commit comments

Comments
 (0)