Skip to content

Commit fbc37d6

Browse files
authored
#29 (#30)
1 parent a5f3aa9 commit fbc37d6

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog], [markdownlint],
66
and this project adheres to [Semantic Versioning].
77

8+
### Changed in 0.0.5
9+
10+
- Modified configuration examples for new szconfig and szconfigmanager pattern
11+
812
### Added to 0.0.4
913

1014
- C# examples

python/configuration/README.md

+4-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
# Deleting Data
2-
The deletion snippets outline deleting previously added source records. Deleting source records removes the previously added source record from the system, completes the entity resolution process and persists outcomes in the Senzing repository.
3-
4-
Deleting a record only requires the data source code and record ID for the record to be deleted.
1+
# Configuration
2+
Configuration related examples.
53

64
## Snippets
7-
* **DeleteFutures.py**
8-
* Read and delete source records from a file using multiple threads
9-
* **DeleteLoop.py**
10-
* Basic read and delete source records from a file
11-
* **DeleteWithInfoFutures.py**
12-
* Read and delete source records from a file using multiple threads
13-
* Collect the response from the [with info](../../../README.md#with-info) version of the API and write it to a file
5+
* **add_data_sources.py**
6+
* Add new data source codes.
147

python/configuration/add_data_sources.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,21 @@
1212

1313

1414
try:
15-
sz_factory = SzAbstractFactoryCore("add_records", SETTINGS, verbose_logging=False)
16-
sz_config = sz_factory.create_config()
15+
sz_factory = SzAbstractFactoryCore("add_data_source", SETTINGS, verbose_logging=False)
1716
sz_configmanager = sz_factory.create_configmanager()
1817

1918
config_id = sz_configmanager.get_default_config_id()
20-
config_definition = sz_configmanager.get_config(config_id)
21-
config_handle = sz_config.import_config(config_definition)
19+
sz_config = sz_configmanager.create_config_from_config_id(config_id)
2220

2321
for data_source in ("CUSTOMERS", "REFERENCE", "WATCHLIST"):
24-
response = sz_config.add_data_source(config_handle, data_source)
22+
_ = sz_config.add_data_source(data_source)
2523

26-
config_definition = sz_config.export_config(config_handle)
27-
config_id = sz_configmanager.add_config(config_definition, INSTANCE_NAME)
24+
new_config = sz_config.export()
25+
new_config_id = sz_configmanager.register_config(new_config, INSTANCE_NAME)
2826
sz_configmanager.set_default_config_id(config_id)
2927

30-
response2 = sz_config.get_data_sources(config_handle)
31-
sz_config.close_config(config_handle)
32-
print(response2)
28+
sz_config = sz_configmanager.create_config_from_config_id(new_config_id)
29+
response = sz_config.get_data_sources()
30+
print(response)
3331
except SzError as err:
3432
print(f"{err.__class__.__name__} - {err}", file=sys.stderr)

0 commit comments

Comments
 (0)