streamlit-octostar-utils 0.6.3.dev1__tar.gz → 0.6.5.dev1__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.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/PKG-INFO +1 -1
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/pyproject.toml +1 -1
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/celery.py +7 -1
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/nifi.py +23 -6
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/LICENSE +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/README.md +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/contents.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/fastapi.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parallelism.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/combine_fields.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/entities_parser.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/generics.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/info.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/linkchart_functions.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/matches.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/parameters.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/rules.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/api_crafter/parser/signals.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/core/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/core/dict.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/core/filetypes.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/core/opensearch_conversion.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/core/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/core/threading/key_queue.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/core/timestamp.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/nlp/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/nlp/custom_recognizers.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/nlp/language.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/nlp/ner.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/octostar/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/octostar/client.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/octostar/context.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/octostar/permissions.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/ontology/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/ontology/inheritance.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/ontology/relationships.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/ontology/validation.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/style/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/style/common.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/threading/async_task_manager.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/threading/session_callback_manager.py +0 -0
- {streamlit_octostar_utils-0.6.3.dev1 → streamlit_octostar_utils-0.6.5.dev1}/streamlit_octostar_utils/threading/session_state_hot_swapper.py +0 -0
|
@@ -352,6 +352,7 @@ class CeleryQueueConfig:
|
|
|
352
352
|
max_tasks_per_child=None,
|
|
353
353
|
max_memory_per_child=None,
|
|
354
354
|
warn_memory_per_child=None,
|
|
355
|
+
worker_env=None,
|
|
355
356
|
**options,
|
|
356
357
|
):
|
|
357
358
|
self.n_workers = n_workers
|
|
@@ -359,6 +360,7 @@ class CeleryQueueConfig:
|
|
|
359
360
|
self.max_tasks_per_child = max_tasks_per_child
|
|
360
361
|
self.max_memory_per_child = max_memory_per_child # KiB — hard limit, worker restarted
|
|
361
362
|
self.warn_memory_per_child = warn_memory_per_child # KiB — soft limit, logs WARNING
|
|
363
|
+
self.worker_env = dict(worker_env) if worker_env else {}
|
|
362
364
|
self.options = options
|
|
363
365
|
|
|
364
366
|
|
|
@@ -800,6 +802,10 @@ class CeleryExecutor(object):
|
|
|
800
802
|
f"PYTHONPATH={os.getcwd()}",
|
|
801
803
|
f"CELERY_WORKER_QUEUES={queue}",
|
|
802
804
|
f"CELERY_WORKER_NAME={worker_name}",
|
|
805
|
+
]
|
|
806
|
+
for env_key, env_val in queue_config.worker_env.items():
|
|
807
|
+
command.append(f"{env_key}={env_val}")
|
|
808
|
+
command.extend([
|
|
803
809
|
"celery",
|
|
804
810
|
"--app",
|
|
805
811
|
f"{self.filename}.{self.name}",
|
|
@@ -808,7 +814,7 @@ class CeleryExecutor(object):
|
|
|
808
814
|
"--concurrency=1",
|
|
809
815
|
f"--loglevel={self.loglevel}",
|
|
810
816
|
f"-n {worker_name}",
|
|
811
|
-
]
|
|
817
|
+
])
|
|
812
818
|
if queue_config.max_tasks_per_child is not None:
|
|
813
819
|
command.append(f"--max-tasks-per-child={queue_config.max_tasks_per_child}")
|
|
814
820
|
if queue_config.max_memory_per_child is not None:
|
|
@@ -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,7 +1069,8 @@ 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
|
+
def sync_entities(self, allowed_flags=None):
|
|
1073
|
+
effective_flags = allowed_flags if allowed_flags is not None else self.sync_allowed_flags
|
|
1072
1074
|
if not self.lazy_sync:
|
|
1073
1075
|
entities = self.out_entities
|
|
1074
1076
|
else:
|
|
@@ -1076,9 +1078,18 @@ class NifiContextManager(object):
|
|
|
1076
1078
|
if not entities:
|
|
1077
1079
|
return
|
|
1078
1080
|
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1081
|
+
run_writes = effective_flags is None or NifiContextManager.SyncFlag.WRITE_CONTENTS in effective_flags
|
|
1082
|
+
run_upserts = effective_flags is None or (
|
|
1083
|
+
NifiContextManager.SyncFlag.UPSERT_ENTITY_ALL in effective_flags
|
|
1084
|
+
or NifiContextManager.SyncFlag.UPSERT_ENTITY_SPECIFIC_FIELDS in effective_flags
|
|
1085
|
+
)
|
|
1086
|
+
run_fetch = effective_flags is None or NifiContextManager.SyncFlag.FETCH_RELATIONSHIPS in effective_flags
|
|
1087
|
+
|
|
1088
|
+
attachables_to_write = self._find_attachables_to_write(entities) if run_writes else []
|
|
1089
|
+
entities_to_upsert = self._find_entities_to_upsert(entities) if run_upserts else []
|
|
1090
|
+
fetch_rel_entities, fetch_concept_rels = (
|
|
1091
|
+
self._find_relationships_to_fetch(entities) if run_fetch else ({}, {})
|
|
1092
|
+
)
|
|
1082
1093
|
|
|
1083
1094
|
all_entities_to_modify = attachables_to_write + [e[0] for e in entities_to_upsert]
|
|
1084
1095
|
with self.reindex_lock(all_entities_to_modify) as locked:
|
|
@@ -1091,8 +1102,14 @@ class NifiContextManager(object):
|
|
|
1091
1102
|
for entity in all_entities_to_modify:
|
|
1092
1103
|
entity.request["is_temporary"] = False
|
|
1093
1104
|
|
|
1094
|
-
|
|
1095
|
-
entity
|
|
1105
|
+
if effective_flags is None:
|
|
1106
|
+
for entity in entities:
|
|
1107
|
+
entity.sync_params = {}
|
|
1108
|
+
else:
|
|
1109
|
+
for entity in entities:
|
|
1110
|
+
entity.sync_params = {
|
|
1111
|
+
k: v for k, v in entity.sync_params.items() if k not in effective_flags
|
|
1112
|
+
}
|
|
1096
1113
|
|
|
1097
1114
|
def _find_attachables_to_write(self, entities) -> list:
|
|
1098
1115
|
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
|