streamlit-octostar-utils 0.5.0.dev2__tar.gz → 0.5.0.dev3__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.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/PKG-INFO +1 -1
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/pyproject.toml +1 -1
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/nifi.py +61 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/LICENSE +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/README.md +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/celery.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/contents.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/fastapi.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parallelism.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/combine_fields.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/entities_parser.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/generics.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/info.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/linkchart_functions.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/matches.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/parameters.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/rules.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/api_crafter/parser/signals.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/core/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/core/dict.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/core/filetypes.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/core/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/core/threading/key_queue.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/core/timestamp.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/nlp/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/nlp/custom_recognizers.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/nlp/language.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/nlp/ner.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/octostar/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/octostar/client.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/octostar/context.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/octostar/permissions.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/ontology/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/ontology/inheritance.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/ontology/relationships.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/ontology/validation.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/style/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/style/common.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/threading/__init__.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/threading/async_task_manager.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/threading/session_callback_manager.py +0 -0
- {streamlit_octostar_utils-0.5.0.dev2 → streamlit_octostar_utils-0.5.0.dev3}/streamlit_octostar_utils/threading/session_state_hot_swapper.py +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from copy import deepcopy
|
|
2
|
+
import hashlib
|
|
2
3
|
import uuid
|
|
3
4
|
from functools import wraps
|
|
4
5
|
from contextlib import contextmanager
|
|
@@ -388,6 +389,66 @@ class NifiFragmenter(object):
|
|
|
388
389
|
]
|
|
389
390
|
return parent_fn(tree, child_results)
|
|
390
391
|
|
|
392
|
+
_FRAGMENTS_NAMESPACE = b"octostar.pipeline.fragments"
|
|
393
|
+
|
|
394
|
+
@staticmethod
|
|
395
|
+
def _create_deterministic_uuid(namespace: bytes, data: bytes):
|
|
396
|
+
return str(
|
|
397
|
+
uuid.uuid5(
|
|
398
|
+
uuid.UUID(bytes=hashlib.md5(namespace).digest()),
|
|
399
|
+
hashlib.md5(data).hexdigest(),
|
|
400
|
+
)
|
|
401
|
+
)
|
|
402
|
+
|
|
403
|
+
@staticmethod
|
|
404
|
+
def create_fragment_uuid(os_entity_uid, stable_fragment_identifier, processor_name, os_workspace):
|
|
405
|
+
"""Create a deterministic UUID for a fragment.
|
|
406
|
+
|
|
407
|
+
The UUID is stable across re-runs for the same entity, fragment
|
|
408
|
+
identifier, processor, and workspace -- enabling idempotent fragment
|
|
409
|
+
creation while ensuring uniqueness across workspaces.
|
|
410
|
+
|
|
411
|
+
Args:
|
|
412
|
+
os_entity_uid: The parent entity UID.
|
|
413
|
+
stable_fragment_identifier: A unique and stable identifier within
|
|
414
|
+
the fragmentation (e.g. page range, keyframe number, face index).
|
|
415
|
+
processor_name: Name of the NiFi processor.
|
|
416
|
+
os_workspace: The workspace UID the fragment will be written to.
|
|
417
|
+
|
|
418
|
+
Returns:
|
|
419
|
+
A deterministic UUID string.
|
|
420
|
+
"""
|
|
421
|
+
return NifiFragmenter._create_deterministic_uuid(
|
|
422
|
+
NifiFragmenter._FRAGMENTS_NAMESPACE,
|
|
423
|
+
(processor_name + "::" + os_workspace + "::" + os_entity_uid + "::" + stable_fragment_identifier).encode("utf-8"),
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
@staticmethod
|
|
427
|
+
def resolve_source_entity_uid(entity, fragment_root_source=None) -> str:
|
|
428
|
+
"""Resolve the source_entity_uid to use for child fragments.
|
|
429
|
+
|
|
430
|
+
When fragment_root_source is set (a fragment name or stack index),
|
|
431
|
+
the UID is looked up via entity.get_fragment_root_uid() -- this is
|
|
432
|
+
necessary when the current entity is a clone that may not be persisted.
|
|
433
|
+
Otherwise falls back to the entity's own UID.
|
|
434
|
+
|
|
435
|
+
Args:
|
|
436
|
+
entity: A NifiEntity or NifiEntityProxy.
|
|
437
|
+
fragment_root_source: None to use the entity's own UID, an int
|
|
438
|
+
to index into the fragments stack, or a string fragmenter
|
|
439
|
+
keylist name.
|
|
440
|
+
|
|
441
|
+
Returns:
|
|
442
|
+
The resolved source entity UID string.
|
|
443
|
+
"""
|
|
444
|
+
if fragment_root_source is None:
|
|
445
|
+
return entity.record["os_entity_uid"]
|
|
446
|
+
try:
|
|
447
|
+
idx = int(fragment_root_source)
|
|
448
|
+
return entity.get_fragment_root_uid(idx)
|
|
449
|
+
except (ValueError, TypeError):
|
|
450
|
+
return entity.get_fragment_root_uid(fragment_root_source)
|
|
451
|
+
|
|
391
452
|
|
|
392
453
|
class NifiEntityBatch(object):
|
|
393
454
|
def __init__(self, entities, config, config_key):
|
|
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
|