Skip to content

Commit 5a2b80e

Browse files
committed
1 parent 3ea0219 commit 5a2b80e

5 files changed

Lines changed: 26 additions & 29 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning].
77

88
## [Unreleased]
99

10+
## [0.2.11] - 2025-05-05
11+
12+
### Changed in 0.2.11
13+
14+
- Fixed incorrect flag defaults in szengine.py
15+
- Fixed incorrect flag defaults in szengine.py in doc strings
16+
- Spelling corrections
17+
1018
## [0.2.10] - 2025-04-30
1119

1220
### Changed in 0.2.10

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = senzing
3-
version = 0.2.10
3+
version = 0.2.11
44
author = senzing
55
author_email = support@senzing.com
66
description = Python SDK method definitions

src/senzing/szengine.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def find_network_by_entity_id(
289289
max_degrees (int): The maximum number of degrees in paths between search entities.
290290
build_out_degrees (int): The number of degrees of relationships to show around each search entity.
291291
build_out_max_entities (int): The maximum number of entities to return in the discovered network.
292-
flags (int, optional): The maximum number of entities to return in the discovered network. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS.
292+
flags (int, optional): The maximum number of entities to return in the discovered network. Defaults to SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS.
293293
294294
Returns:
295295
str: A JSON document.
@@ -329,7 +329,7 @@ def find_network_by_record_id(
329329
max_degrees (int): The maximum number of degrees in paths between search entities.
330330
build_out_degrees (int): The number of degrees of relationships to show around each search entity.
331331
build_out_max_entities (int): The maximum number of entities to return in the discovered network.
332-
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS.
332+
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS.
333333
334334
Returns:
335335
str: A JSON document.
@@ -622,7 +622,7 @@ def get_virtual_entity_by_record_id(
622622
623623
Args:
624624
record_keys (list(tuple(str, str))): The data source codes and record IDs identifying records to create the virtual entity from.
625-
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS.
625+
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_VIRTUAL_ENTITY_DEFAULT_FLAGS.
626626
627627
Returns:
628628
str: A JSON document.
@@ -686,7 +686,7 @@ def preprocess_record(
686686
687687
Args:
688688
record_definition (str): A JSON document containing the record to be tested.
689-
flags (int, optional): Flags used to control information returned. Defaults to 0.
689+
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS.
690690
691691
Returns:
692692
str: A JSON document containing metadata as specified by the flags.
@@ -845,7 +845,7 @@ def why_entities(
845845
Args:
846846
entity_id_1 (int): The entity ID for the starting entity of the search path.
847847
entity_id_2 (int): The entity ID for the ending entity of the search path.
848-
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_WHY_ENTITY_DEFAULT_FLAGS.
848+
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS.
849849
850850
Returns:
851851
str: A JSON document.
@@ -870,15 +870,15 @@ def why_record_in_entity(
870870
self,
871871
data_source_code: str,
872872
record_id: str,
873-
flags: int = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS,
873+
flags: int = SzEngineFlags.SZ_WHY_RECORD_IN_ENTITY_DEFAULT_FLAGS,
874874
) -> str:
875875
"""
876876
The `why_record_in_entity` method determines why a record is included in an entity.
877877
878878
Args:
879879
data_source_code (str): Identifies the provenance of the data.
880880
record_id (str): The unique identifier within the records of the same data source.
881-
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_WHY_ENTITY_DEFAULT_FLAGS.
881+
flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_WHY_RECORD_IN_ENTITY_DEFAULT_FLAGS.
882882
883883
Returns:
884884
str: A JSON document.

src/senzing/szengineflags.py

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -220,26 +220,11 @@ def flags_by_value(cls) -> Dict[int, str]:
220220
)
221221

222222
# The recommended default flag values for why-analysis on entities.
223-
SZ_WHY_ENTITIES_DEFAULT_FLAGS = (
224-
SZ_ENTITY_DEFAULT_FLAGS
225-
| SZ_ENTITY_INCLUDE_INTERNAL_FEATURES
226-
| SZ_ENTITY_INCLUDE_FEATURE_STATS
227-
| SZ_INCLUDE_FEATURE_SCORES
228-
)
223+
SZ_WHY_ENTITIES_DEFAULT_FLAGS = SZ_INCLUDE_FEATURE_SCORES
229224

230-
SZ_WHY_RECORDS_DEFAULT_FLAGS = (
231-
SZ_ENTITY_DEFAULT_FLAGS
232-
| SZ_ENTITY_INCLUDE_INTERNAL_FEATURES
233-
| SZ_ENTITY_INCLUDE_FEATURE_STATS
234-
| SZ_INCLUDE_FEATURE_SCORES
235-
)
225+
SZ_WHY_RECORDS_DEFAULT_FLAGS = SZ_INCLUDE_FEATURE_SCORES
236226

237-
SZ_WHY_RECORD_IN_ENTITY_DEFAULT_FLAGS = (
238-
SZ_ENTITY_DEFAULT_FLAGS
239-
| SZ_ENTITY_INCLUDE_INTERNAL_FEATURES
240-
| SZ_ENTITY_INCLUDE_FEATURE_STATS
241-
| SZ_INCLUDE_FEATURE_SCORES
242-
)
227+
SZ_WHY_RECORD_IN_ENTITY_DEFAULT_FLAGS = SZ_INCLUDE_FEATURE_SCORES
243228

244229
SZ_WHY_SEARCH_DEFAULT_FLAGS = (
245230
SZ_INCLUDE_FEATURE_SCORES | SZ_SEARCH_INCLUDE_REQUEST_DETAILS | SZ_SEARCH_INCLUDE_STATS
@@ -260,6 +245,7 @@ def flags_by_value(cls) -> Dict[int, str]:
260245
| SZ_ENTITY_INCLUDE_ENTITY_NAME
261246
| SZ_ENTITY_INCLUDE_RECORD_SUMMARY
262247
| SZ_INCLUDE_FEATURE_SCORES
248+
| SZ_SEARCH_INCLUDE_STATS
263249
)
264250

265251
# The recommended flag values for searching by attributes, returning only strongly matching entities.
@@ -270,13 +256,16 @@ def flags_by_value(cls) -> Dict[int, str]:
270256
| SZ_ENTITY_INCLUDE_ENTITY_NAME
271257
| SZ_ENTITY_INCLUDE_RECORD_SUMMARY
272258
| SZ_INCLUDE_FEATURE_SCORES
259+
| SZ_SEARCH_INCLUDE_STATS
273260
)
274261

275262
# Return minimal data with all matches.
276-
SZ_SEARCH_BY_ATTRIBUTES_MINIMAL_ALL = SZ_SEARCH_INCLUDE_ALL_ENTITIES
263+
SZ_SEARCH_BY_ATTRIBUTES_MINIMAL_ALL = SZ_SEARCH_INCLUDE_ALL_ENTITIES | SZ_SEARCH_INCLUDE_STATS
277264

278265
# Return minimal data with only the strongest matches.
279-
SZ_SEARCH_BY_ATTRIBUTES_MINIMAL_STRONG = SZ_SEARCH_INCLUDE_RESOLVED | SZ_SEARCH_INCLUDE_POSSIBLY_SAME
266+
SZ_SEARCH_BY_ATTRIBUTES_MINIMAL_STRONG = (
267+
SZ_SEARCH_INCLUDE_RESOLVED | SZ_SEARCH_INCLUDE_POSSIBLY_SAME | SZ_SEARCH_INCLUDE_STATS
268+
)
280269

281270
# Rhe recommended default flag values for search-by-attributes.
282271
SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS = SZ_SEARCH_BY_ATTRIBUTES_ALL

src/senzing/szerror.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class SzDatabaseError(SzUnrecoverableError):
136136

137137

138138
class SzLicenseError(SzUnrecoverableError):
139-
"""Licence exception"""
139+
"""License exception"""
140140

141141

142142
class SzNotInitializedError(SzUnrecoverableError):

0 commit comments

Comments
 (0)