streamlit-octostar-utils 0.6.4__tar.gz → 0.6.5.dev2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/PKG-INFO +1 -1
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/pyproject.toml +1 -1
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/nifi.py +34 -10
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/LICENSE +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/README.md +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/celery.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/contents.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/fastapi.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parallelism.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/combine_fields.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/entities_parser.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/generics.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/info.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/linkchart_functions.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/matches.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/parameters.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/rules.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/api_crafter/parser/signals.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/core/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/core/dict.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/core/filetypes.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/core/opensearch_conversion.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/core/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/core/threading/key_queue.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/core/timestamp.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/nlp/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/nlp/custom_recognizers.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/nlp/language.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/nlp/ner.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/octostar/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/octostar/client.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/octostar/context.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/octostar/permissions.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/ontology/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/ontology/inheritance.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/ontology/relationships.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/ontology/validation.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/style/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/style/common.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/threading/async_task_manager.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/threading/session_callback_manager.py +0 -0
- {streamlit_octostar_utils-0.6.4 → streamlit_octostar_utils-0.6.5.dev2}/streamlit_octostar_utils/threading/session_state_hot_swapper.py +0 -0
|
@@ -668,6 +668,7 @@ class NifiContextManager(object):
|
|
|
668
668
|
self.out_entities = None
|
|
669
669
|
self.nonlazy_sync_ids = set()
|
|
670
670
|
self.lazy_sync = lazy_sync
|
|
671
|
+
self.sync_allowed_flags = None
|
|
671
672
|
self.client, self.ontology_name = self.get_client(json_data)
|
|
672
673
|
self._ontology = None
|
|
673
674
|
self._input_loader = input_loader
|
|
@@ -1068,17 +1069,34 @@ class NifiContextManager(object):
|
|
|
1068
1069
|
if statuses:
|
|
1069
1070
|
update_processing_status.sync(statuses, client=self.client)
|
|
1070
1071
|
|
|
1071
|
-
def sync_entities(self):
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1072
|
+
def sync_entities(self, allowed_flags=None, entities=None):
|
|
1073
|
+
"""Run sync for ``entities`` (defaults to ``self.out_entities`` honoring
|
|
1074
|
+
``lazy_sync``/``nonlazy_sync_ids``). Passing ``entities`` explicitly
|
|
1075
|
+
bypasses the ``out_entities`` filter — useful for routes that want to
|
|
1076
|
+
trigger a sync from inside their task body (i.e. before ``send_output``
|
|
1077
|
+
has populated ``out_entities``) and catch failures locally.
|
|
1078
|
+
"""
|
|
1079
|
+
effective_flags = allowed_flags if allowed_flags is not None else self.sync_allowed_flags
|
|
1080
|
+
if entities is None:
|
|
1081
|
+
if not self.lazy_sync:
|
|
1082
|
+
entities = self.out_entities
|
|
1083
|
+
else:
|
|
1084
|
+
entities = [e for e in self.out_entities if e.record["entity_id"] in self.nonlazy_sync_ids]
|
|
1076
1085
|
if not entities:
|
|
1077
1086
|
return
|
|
1078
1087
|
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1088
|
+
run_writes = effective_flags is None or NifiContextManager.SyncFlag.WRITE_CONTENTS in effective_flags
|
|
1089
|
+
run_upserts = effective_flags is None or (
|
|
1090
|
+
NifiContextManager.SyncFlag.UPSERT_ENTITY_ALL in effective_flags
|
|
1091
|
+
or NifiContextManager.SyncFlag.UPSERT_ENTITY_SPECIFIC_FIELDS in effective_flags
|
|
1092
|
+
)
|
|
1093
|
+
run_fetch = effective_flags is None or NifiContextManager.SyncFlag.FETCH_RELATIONSHIPS in effective_flags
|
|
1094
|
+
|
|
1095
|
+
attachables_to_write = self._find_attachables_to_write(entities) if run_writes else []
|
|
1096
|
+
entities_to_upsert = self._find_entities_to_upsert(entities) if run_upserts else []
|
|
1097
|
+
fetch_rel_entities, fetch_concept_rels = (
|
|
1098
|
+
self._find_relationships_to_fetch(entities) if run_fetch else ({}, {})
|
|
1099
|
+
)
|
|
1082
1100
|
|
|
1083
1101
|
all_entities_to_modify = attachables_to_write + [e[0] for e in entities_to_upsert]
|
|
1084
1102
|
with self.reindex_lock(all_entities_to_modify) as locked:
|
|
@@ -1091,8 +1109,14 @@ class NifiContextManager(object):
|
|
|
1091
1109
|
for entity in all_entities_to_modify:
|
|
1092
1110
|
entity.request["is_temporary"] = False
|
|
1093
1111
|
|
|
1094
|
-
|
|
1095
|
-
entity
|
|
1112
|
+
if effective_flags is None:
|
|
1113
|
+
for entity in entities:
|
|
1114
|
+
entity.sync_params = {}
|
|
1115
|
+
else:
|
|
1116
|
+
for entity in entities:
|
|
1117
|
+
entity.sync_params = {
|
|
1118
|
+
k: v for k, v in entity.sync_params.items() if k not in effective_flags
|
|
1119
|
+
}
|
|
1096
1120
|
|
|
1097
1121
|
def _find_attachables_to_write(self, entities) -> list:
|
|
1098
1122
|
attachables_to_write = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|