Skip to content

Commit 5304ffe

Browse files
authored
Merge pull request #721 from hmcts/feature-databricks-active-listing-ariadm-1473-listing-state
Feature databricks active listing ariadm 1473 listing state
2 parents 06e03a2 + 03468a0 commit 5304ffe

29 files changed

+3299
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__pycache__/
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
resources:
2+
pipelines:
3+
pipeline_pl_listing_gold:
4+
name: PL_listing_gold
5+
configuration:
6+
pipelines.tableManagedByMultiplePipelinesCheck.enabled: "false"
7+
clusters:
8+
- label: default
9+
node_type_id: Standard_D4ads_v5
10+
driver_node_type_id: Standard_D4ads_v5
11+
autoscale:
12+
min_workers: 1
13+
max_workers: 8
14+
mode: ENHANCED
15+
libraries:
16+
- notebook:
17+
path: "/Workspace/live/ACTIVE/APPEALS/GOLD_LISTING_JSON"
18+
target: listing_gold
19+
development: true
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
resources:
2+
jobs:
3+
listing_payload_databricks_job:
4+
name: listing_payload_databricks_job
5+
job_clusters:
6+
- job_cluster_key: listing_payload_databricks_job
7+
new_cluster:
8+
spark_version: 14.3.x-scala2.12
9+
node_type_id: Standard_D8ds_v5
10+
num_workers: 8
11+
tasks:
12+
- task_key: run-my-wheel
13+
job_cluster_key: listing_payload_databricks_job
14+
python_wheel_task:
15+
entry_point: main
16+
package_name: shared_functions
17+
libraries:
18+
- whl: "dbfs:/FileStore/packages/shared_functions-0.6.6-py3-none-any.whl"
19+
20+
- task_key: DLT_listing
21+
depends_on:
22+
- task_key: run-my-wheel
23+
pipeline_task:
24+
pipeline_id: ${resources.pipelines.pipeline_pl_listing_gold.id}
25+
full_refresh: true
26+
27+
- task_key: active_publish_EH_HTML_JSON
28+
depends_on:
29+
- task_key: DLT_listing
30+
job_cluster_key: listing_payload_databricks_job
31+
notebook_task:
32+
notebook_path: "/Workspace/live/ACTIVE/MVP/Active_Publish_EH_HTML_JSON"
33+
source: WORKSPACE
34+
base_parameters:
35+
state: listing
36+
37+
queue:
38+
enabled: true
Binary file not shown.

Databricks/ACTIVE/APPEALS/BRONZE_ACTIVE_APPEALS.ipynb

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,72 @@
22632263
"display(bronze_appealtype)"
22642264
]
22652265
},
2266+
{
2267+
"cell_type": "markdown",
2268+
"metadata": {
2269+
"application/vnd.databricks.v1+cell": {
2270+
"cellMetadata": {
2271+
"byteLimit": 2048000,
2272+
"rowLimit": 10000
2273+
},
2274+
"inputWidgets": {},
2275+
"nuid": "fda46dc4-e7af-4243-926b-f6efaad6af03",
2276+
"showTitle": false,
2277+
"tableResultSettingsMap": {},
2278+
"title": ""
2279+
}
2280+
},
2281+
"source": [
2282+
"### Transformation bronze_interpreter_languages"
2283+
]
2284+
},
2285+
{
2286+
"cell_type": "code",
2287+
"execution_count": 0,
2288+
"metadata": {
2289+
"application/vnd.databricks.v1+cell": {
2290+
"cellMetadata": {
2291+
"byteLimit": 2048000,
2292+
"rowLimit": 10000
2293+
},
2294+
"inputWidgets": {},
2295+
"nuid": "d77d7399-47a1-44c0-89c8-2cf3b39944b4",
2296+
"showTitle": false,
2297+
"tableResultSettingsMap": {},
2298+
"title": ""
2299+
}
2300+
},
2301+
"outputs": [],
2302+
"source": [
2303+
"@dlt.table(\n",
2304+
" name=\"bronze_interpreter_languages\",\n",
2305+
" comment=\"DLT table for interpreter languages, associated to the case by m1 appealCase LanguageId\",\n",
2306+
" path=f\"{bronze_path}/bronze_interpreter_language\"\n",
2307+
")\n",
2308+
"def bronze_interpreter_languages():\n",
2309+
" schema = StructType([\n",
2310+
" StructField(\"LanguageId\", IntegerType(), True),\n",
2311+
" StructField(\"Description\", StringType(), True),\n",
2312+
" StructField(\"appellantinterpreterLanguageCategory\", StringType(), True),\n",
2313+
" StructField(\"languageCode\", StringType(), True),\n",
2314+
" StructField(\"languageLabel\", StringType(), True),\n",
2315+
" StructField(\"manualEntry\", StringType(), True),\n",
2316+
" StructField(\"manualEntryDescription\", StringType(), True)\n",
2317+
" ])\n",
2318+
" \n",
2319+
" return (\n",
2320+
" spark.read.format(\"csv\")\n",
2321+
" .option(\"header\", \"true\")\n",
2322+
" .option(\"inferSchema\", \"false\")\n",
2323+
" .option(\"encoding\", \"UTF-8\")\n",
2324+
" .option(\"multiline\", \"true\")\n",
2325+
" .option(\"escape\", \"\\\"\")\n",
2326+
" .schema(schema)\n",
2327+
" .load(f\"abfss://external-csv@{external_storage}.dfs.core.windows.net/ReferenceData/interpreter_language.csv\")\n",
2328+
" .select(\"*\")\n",
2329+
" )"
2330+
]
2331+
},
22662332
{
22672333
"cell_type": "markdown",
22682334
"metadata": {

0 commit comments

Comments
 (0)