streamlit-octostar-utils 0.2.1__tar.gz → 0.2.3__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.
Files changed (42) hide show
  1. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/PKG-INFO +1 -1
  2. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/pyproject.toml +1 -1
  3. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/nifi.py +25 -4
  4. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/LICENSE +0 -0
  5. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/README.md +0 -0
  6. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/__init__.py +0 -0
  7. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/__init__.py +0 -0
  8. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/celery.py +0 -0
  9. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/fastapi.py +0 -0
  10. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/__init__.py +0 -0
  11. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/combine_fields.py +0 -0
  12. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/entities_parser.py +0 -0
  13. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/generics.py +0 -0
  14. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/info.py +0 -0
  15. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/linkchart_functions.py +0 -0
  16. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/matches.py +0 -0
  17. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/parameters.py +0 -0
  18. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/rules.py +0 -0
  19. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/api_crafter/parser/signals.py +0 -0
  20. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/core/__init__.py +0 -0
  21. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/core/dict.py +0 -0
  22. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/core/filetypes.py +0 -0
  23. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/core/threading/__init__.py +0 -0
  24. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/core/threading/key_queue.py +0 -0
  25. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/core/timestamp.py +0 -0
  26. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/nlp/__init__.py +0 -0
  27. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/nlp/language.py +0 -0
  28. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/nlp/ner.py +0 -0
  29. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/octostar/__init__.py +0 -0
  30. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/octostar/client.py +0 -0
  31. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/octostar/context.py +0 -0
  32. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/octostar/permissions.py +0 -0
  33. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/ontology/__init__.py +0 -0
  34. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/ontology/expand_entities.py +0 -0
  35. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/ontology/inheritance.py +0 -0
  36. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/ontology/validation.py +0 -0
  37. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/style/__init__.py +0 -0
  38. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/style/common.py +0 -0
  39. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/threading/__init__.py +0 -0
  40. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/threading/async_task_manager.py +0 -0
  41. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/threading/session_callback_manager.py +0 -0
  42. {streamlit_octostar_utils-0.2.1 → streamlit_octostar_utils-0.2.3}/streamlit_octostar_utils/threading/session_state_hot_swapper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: streamlit-octostar-utils
3
- Version: 0.2.1
3
+ Version: 0.2.3
4
4
  Summary:
5
5
  License: MIT
6
6
  Author: Octostar
@@ -5,7 +5,7 @@ include = '\.pyi?$'
5
5
 
6
6
  [tool.poetry]
7
7
  name = "streamlit-octostar-utils"
8
- version = "0.2.1"
8
+ version = "0.2.3"
9
9
  description = ""
10
10
  license = "MIT"
11
11
  authors = ["Octostar"]
@@ -81,6 +81,7 @@ class NifiEntityModel(BaseModel):
81
81
  sync_params: dict = Field(default_factory=dict)
82
82
  nifi_attributes: dict = Field(default_factory=dict)
83
83
  config: dict = Field(default_factory=dict)
84
+ metrics: dict = Field(default_factory=dict)
84
85
  contents_pointer: Optional[ContentsPointerModel] = None
85
86
  is_temporary: bool = False
86
87
  exception: dict = Field(default_factory=dict)
@@ -843,9 +844,26 @@ class NifiEntity(object):
843
844
  entity_type == type or type in self.request["ontology_info"]["parents"]
844
845
  )
845
846
 
846
- def is_fragmented(self):
847
+ def is_fragmented(self) -> bool:
847
848
  return bool(self.request["config"].get("fragment", {}).get("fragments_stack"))
848
849
 
850
+ def is_root_fragment(self, entity) -> bool:
851
+ def _is_sub_fragment_recursive(fragment: dict) -> bool:
852
+ if not isinstance(fragment, dict):
853
+ return False
854
+ if all(k in fragment for k in ["index", "count", "identifier"]):
855
+ return fragment.get("index", 0) != 0
856
+ for value in fragment.values():
857
+ if isinstance(value, dict):
858
+ if _is_sub_fragment_recursive(value):
859
+ return True
860
+ return False
861
+
862
+ if not self.is_fragmented():
863
+ return True
864
+ fragment = entity.request.get("config", {}).get("fragment", {})
865
+ return not _is_sub_fragment_recursive(fragment)
866
+
849
867
  def to_json(self):
850
868
  def _safe_encode(contents):
851
869
  return base64.b64encode(contents) if contents else None
@@ -911,13 +929,16 @@ class NifiEntity(object):
911
929
  "relationships"
912
930
  ],
913
931
  },
932
+ "entity_timestamp": None,
914
933
  "sync_params": {},
915
934
  "nifi_attributes": {},
916
935
  "config": deepcopy(self.request["config"]),
917
- "fallback_os_workspace": self.request["fallback_os_workspace"],
918
- "is_temporary": True,
919
- "entity_timestamp": None,
936
+ "metrics": {},
920
937
  "contents_pointer": None,
938
+ "is_temporary": True,
939
+ "exception": {},
940
+ "last_processor_name": None,
941
+ "fallback_os_workspace": self.request["fallback_os_workspace"],
921
942
  }
922
943
  child_entity = NifiEntity(
923
944
  self.context,