Skip to content

Commit

Permalink
Merge pull request #1016 from roboflow/fix/core-steps-loader-for-envi…
Browse files Browse the repository at this point in the history
…ronmental-variables

adjust initializer for allow_access_to_environmental_variables
  • Loading branch information
grzegorz-roboflow authored Feb 10, 2025
2 parents 057664e + 1843542 commit c1493a6
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 17 deletions.
18 changes: 9 additions & 9 deletions inference/core/interfaces/http/http_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,12 +313,12 @@ async def wrapped_route(*args, **kwargs):
traceback.print_exc()
except WorkflowSyntaxError as error:
content = WorkflowErrorResponse(
message=error.public_message,
message=str(error.public_message),
error_type=error.__class__.__name__,
context=error.context,
inner_error_type=error.inner_error_type,
context=str(error.context),
inner_error_type=str(error.inner_error_type),
inner_error_message=str(error.inner_error),
blocks_errors=error._blocks_errors,
blocks_errors=error.blocks_errors,
)
resp = JSONResponse(status_code=400, content=content.model_dump())
except (
Expand Down Expand Up @@ -448,15 +448,15 @@ async def wrapped_route(*args, **kwargs):
traceback.print_exc()
except StepExecutionError as error:
content = WorkflowErrorResponse(
message=error.public_message,
message=str(error.public_message),
error_type=error.__class__.__name__,
context=error.context,
inner_error_type=error.inner_error_type,
context=str(error.context),
inner_error_type=str(error.inner_error_type),
inner_error_message=str(error.inner_error),
blocks_errors=[
WorkflowBlockError(
block_id=error._block_id,
block_type=error._block_type,
block_id=error.block_id,
block_type=error.block_type,
),
],
)
Expand Down
2 changes: 1 addition & 1 deletion inference/core/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.37.0"
__version__ = "0.37.1"


if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion inference/core/workflows/core_steps/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from inference.core.cache import cache
from inference.core.env import (
ALLOW_WORKFLOW_BLOCKS_ACCESSING_ENVIRONMENTAL_VARIABLES,
ALLOW_WORKFLOW_BLOCKS_ACCESSING_LOCAL_STORAGE,
API_KEY,
WORKFLOW_BLOCKS_WRITE_DIRECTORY,
Expand Down Expand Up @@ -441,7 +442,7 @@
"thread_pool_executor": None,
"allow_access_to_file_system": ALLOW_WORKFLOW_BLOCKS_ACCESSING_LOCAL_STORAGE,
"allowed_write_directory": WORKFLOW_BLOCKS_WRITE_DIRECTORY,
"allow_access_to_environmental_variables": ALLOW_WORKFLOW_BLOCKS_ACCESSING_LOCAL_STORAGE,
"allow_access_to_environmental_variables": ALLOW_WORKFLOW_BLOCKS_ACCESSING_ENVIRONMENTAL_VARIABLES,
}

KINDS_SERIALIZERS = {
Expand Down
10 changes: 5 additions & 5 deletions inference/core/workflows/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ class WorkflowDefinitionError(WorkflowCompilerError):
class WorkflowSyntaxError(WorkflowDefinitionError):
def __init__(
self,
*args,
blocks_errors: Optional[List[WorkflowBlockError]] = None,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self._blocks_errors = blocks_errors
self.blocks_errors = blocks_errors


class DuplicatedNameError(WorkflowDefinitionError):
Expand Down Expand Up @@ -139,14 +139,14 @@ class InvalidBlockBehaviourError(WorkflowExecutionEngineError):
class StepExecutionError(WorkflowExecutionEngineError):
def __init__(
self,
*args,
block_id: str,
block_type: str,
*args,
**kwargs,
):
super().__init__(*args, **kwargs)
self._block_id = block_id
self._block_type = block_type
self.block_id = block_id
self.block_type = block_type


class ExecutionEngineRuntimeError(WorkflowExecutionEngineError):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def safe_execute_step(
block_type=workflow.steps[step_selector.split(".")[-1]].manifest.type,
public_message=str(error),
context="workflow_execution | step_execution",
inner_error=error,
inner_error=str(error),
) from error


Expand Down

0 comments on commit c1493a6

Please sign in to comment.