Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions nifi/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ RUN uv pip install --no-cache-dir --break-system-packages --system --upgrade pip
COPY ./requirements.txt ./requirements.txt
RUN uv pip install --no-cache-dir --break-system-packages --target=${NIFI_PYTHON_FRAMEWORK_SOURCE_DIRECTORY} -r "./requirements.txt"

# install MedCAT from the working with cogstack repo (as it is assumed to be stable and the latest version)
RUN uv pip install --no-cache-dir --break-system-packages --target=${NIFI_PYTHON_FRAMEWORK_SOURCE_DIRECTORY} -r https://raw.githubusercontent.com/CogStack/working_with_cogstack/refs/heads/main/requirements.txt --extra-index-url https://download.pytorch.org/whl/cpu/

#######################################################################################################

# solve groovy grape proxy issues, grape ignores the current environment's proxy settings
Expand Down
6 changes: 3 additions & 3 deletions nifi/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,21 @@ seaborn==0.13.2
matplotlib==3.10.6
graphviz==0.21
plotly==6.3.0
keras==3.12.0
keras==3.12.0
nltk==3.9.1
numpy>=1.26.0,<2.0.0
pandas==1.5.3
dill>=0.3.6,<1.0.0
bokeh==3.8.0
psycopg[c,binary]==3.2.9
overrides==7.0.0

# used in NiFi scripts: geolocation, avro conversion etc.
py4j==0.10.9.9
rancoord==0.0.6
geocoder==1.38.1
avro==1.12.0
nipyapi==1.0.0
nipyapi==1.1.0
py7zr==1.0.0
ipyparallel==9.0.1
cython==3.1.3
Expand All @@ -34,7 +35,6 @@ xnat==0.7.2
opensearch-py==3.0.0
elasticsearch9==9.1.0
neo4j==5.28.2
eland==9.0.1

# git utils
dvc==3.62.0
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.ruff]
line-length = 120
exclude = ["nifi/user-scripts/legacy_scripts"]
exclude = ["nifi/user-scripts/legacy_scripts", "services"]
target-version = "py311"
indent-width = 4

Expand Down
2 changes: 1 addition & 1 deletion services/cogstack-nlp
Submodule cogstack-nlp updated 303 files
23 changes: 23 additions & 0 deletions typings/nifiapi/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
__all__ = [
"FlowFileTransform",
"FlowFileTransformResult",
"ProcessContext",
"PropertyDescriptor",
"StandardValidators",
"Relationship",
]

import nifiapi.flowfiletransform # noqa: F401
import nifiapi.properties # noqa: F401
import nifiapi.relationship # noqa: F401

from .flowfiletransform import (
FlowFileTransform,
FlowFileTransformResult,
ProcessContext,
)
from .properties import (
PropertyDescriptor,
StandardValidators,
)
from .relationship import Relationship
Empty file.
18 changes: 10 additions & 8 deletions typings/nifiapi/flowfiletransform.pyi
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
from typing import Any, Protocol

from nifiapi.properties import ProcessContext
from py4j.java_gateway import JavaObject

from .properties import ProcessContext

# ---------------------
# FlowFileTransform + Result
# ---------------------
class FlowFileTransform(Protocol):
def transform(self, context: ProcessContext, flowFile: JavaObject) -> Any: ...

class FlowFileTransformResult:
def __init__(
self,
relationship: str,
attributes: dict[str, str],
contents: bytes | str | None = None
) -> None : ...



class FlowFileTransform(Protocol):
def transform(self, context: ProcessContext, flowFile: JavaObject) -> Any: ...
contents: bytes | None = None,
) -> None: ...
Empty file added typings/nifiapi/properties.py
Empty file.
57 changes: 57 additions & 0 deletions typings/nifiapi/properties.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from enum import Enum
from typing import Any, Protocol

class ExpressionLanguageScope(Enum):
NONE = 1
ENVIRONMENT = 2
FLOWFILE_ATTRIBUTES = 3


class ProcessContext(Protocol):
def getProperties(self) -> dict[str, Any]: ...


class PropertyDescriptor:
def __init__(self, name, description, required=False, sensitive=False,
display_name=None, default_value=None, allowable_values=None,
dependencies=None, expression_language_scope=ExpressionLanguageScope.NONE,
dynamic=False, validators=None,
resource_definition=None, controller_service_definition=None):
if validators is None:
validators = [StandardValidators.ALWAYS_VALID]

self.name = name
self.description = description
self.required = required
self.sensitive = sensitive
self.displayName = display_name
self.defaultValue = None if default_value is None else str(default_value)
self.allowableValues = allowable_values
self.dependencies = dependencies
self.expressionLanguageScope = expression_language_scope
self.dynamic = dynamic
self.validators = validators
self.resourceDefinition = resource_definition
self.controllerServiceDefinition = controller_service_definition


class StandardValidators:
ALWAYS_VALID: object
NON_EMPTY_VALIDATOR: object
INTEGER_VALIDATOR: object
POSITIVE_INTEGER_VALIDATOR: object
POSITIVE_LONG_VALIDATOR: object
NON_NEGATIVE_INTEGER_VALIDATOR: object
NUMBER_VALIDATOR: object
LONG_VALIDATOR: object
PORT_VALIDATOR: object
NON_EMPTY_EL_VALIDATOR: object
HOSTNAME_PORT_LIST_VALIDATOR: object
BOOLEAN_VALIDATOR: object
URL_VALIDATOR: object
URI_VALIDATOR: object
REGULAR_EXPRESSION_VALIDATOR: object
REGULAR_EXPRESSION_WITH_EL_VALIDATOR: object
TIME_PERIOD_VALIDATOR: object
DATA_SIZE_VALIDATOR: object
FILE_EXISTS_VALIDATOR: object
Empty file added typings/nifiapi/relationship.py
Empty file.
8 changes: 8 additions & 0 deletions typings/nifiapi/relationship.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

class Relationship:
def __init__(self, name: str, description: str = "") -> None: ...

name: str
description: str

raise NotImplementedError
Empty file added typings/py4j/__init__.pyi
Empty file.
2 changes: 1 addition & 1 deletion typings/py4j/java_gateway.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ class JavaObject(Protocol):

class JVMView(Protocol):
"""Stub JVM view"""
pass
pass