Skip to content

Commit

Permalink
#85 Savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Sep 27, 2024
1 parent 640a3f0 commit 1db81f1
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 51 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Stages
# -----------------------------------------------------------------------------

ARG IMAGE_BUILDER=golang:1.22.4-bullseye
ARG IMAGE_BUILDER=golang:1.22.3-bullseye
ARG IMAGE_FINAL=senzing/senzingapi-runtime-staging:latest

# -----------------------------------------------------------------------------
Expand Down
59 changes: 14 additions & 45 deletions rootfs/notebooks/load_user_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "de03a1c2-d7b1-40a9-8154-1df47cd49fef",
"metadata": {},
"outputs": [],
Expand All @@ -72,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "ff9189d1-852d-46b0-9e2e-36f524c9038e",
"metadata": {},
"outputs": [],
Expand All @@ -90,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "04555a6e-9c48-4a9b-b8b0-e7285b602fc8",
"metadata": {},
"outputs": [],
Expand All @@ -116,18 +116,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "7f5cecdf-649a-4a8b-ad64-d2fc3f37166d",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Found the following DATA_SOURCE values in the data: ['MY_DATASOURCE']\n"
]
}
],
"outputs": [],
"source": [
"datasources = []\n",
"\n",
Expand Down Expand Up @@ -159,7 +151,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "3272f76c-dc95-4ff8-b573-8bddd55fb779",
"metadata": {},
"outputs": [],
Expand All @@ -179,7 +171,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "301ce7eb-9069-4c8d-a1c4-ebe8f78d1bf6",
"metadata": {},
"outputs": [],
Expand All @@ -200,7 +192,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"id": "fbf17cc3-3273-4097-90a2-f0b9a21674a1",
"metadata": {},
"outputs": [],
Expand All @@ -220,18 +212,10 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"id": "97854ac2-ad01-4663-9f6c-4afd816230f9",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"id\":\"SZSDK60014001\",\"reason\":\"SENZ2208|Data source code [MY_DATASOURCE] already exists.\"}\n"
]
}
],
"outputs": [],
"source": [
"for datasource in datasources:\n",
" try:\n",
Expand All @@ -250,7 +234,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"id": "32217742-9e09-4778-b7fe-1e23817251ec",
"metadata": {},
"outputs": [],
Expand All @@ -272,7 +256,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"id": "df805089-7a9a-4e4e-b959-c320819e855b",
"metadata": {},
"outputs": [],
Expand All @@ -299,25 +283,10 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"id": "cb8318ec-cd73-4e43-8349-586c8dd0dbfb",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"157616467\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n",
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"115212881\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n",
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"645217904\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n",
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"212359276\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n",
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"526429955\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n",
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"604947448\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n",
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"513789670\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n",
"{\"DATA_SOURCE\":\"MY_DATASOURCE\",\"RECORD_ID\":\"212442489\",\"AFFECTED_ENTITIES\":[],\"INTERESTING_ENTITIES\":{\"ENTITIES\":[]}}\n"
]
}
],
"outputs": [],
"source": [
"with open(filepath, \"r\") as file:\n",
" for line in file:\n",
Expand Down
Empty file modified src/senzing_quickstart/hello_world.py
100644 → 100755
Empty file.
Empty file modified src/senzing_quickstart/load_truthsets.py
100644 → 100755
Empty file.
13 changes: 8 additions & 5 deletions src/senzing_quickstart/load_user_data.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
# coding: utf-8

# # Load user data
#
#
# These instructions show how to load user data into the Senzing engine.

# ## Upload file of records

# The following instructions show how to upload a file of JSON lines.
# Here is an [example file].
#
#
# 1. In upper-left corner of JuypterLab, click on the
# ![Upload Files](img/upload-icon.png)
# ("Upload Files") icon.
# 1. Choose the file of JSON lines to upload.
#
#
# [example file]: https://raw.githubusercontent.com/senzing-garage/demo-quickstart/refs/heads/main/testdata/example-data-for-senzing.json

# ## Prepare Python enviroment
Expand All @@ -25,10 +25,10 @@


import json

import grpc
from senzing_grpc import SzAbstractFactory, SzEngineFlags, SzError


# Set environment specific variables.

# In[ ]:
Expand Down Expand Up @@ -115,7 +115,9 @@


new_json_config = sz_config.export_config(config_handle)
new_config_id = sz_configmanager.add_config(new_json_config, "Add user datasources")
new_config_id = sz_configmanager.add_config(
new_json_config, "Add user datasources"
)
sz_configmanager.replace_default_config_id(old_config_id, new_config_id)


Expand Down Expand Up @@ -148,3 +150,4 @@
print(info)
except SzError as err:
print(err)

0 comments on commit 1db81f1

Please sign in to comment.