Skip to content

Commit

Permalink
fix: Ruff linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ramedina86 committed Sep 30, 2024
1 parent 9f26fba commit 3c00960
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/writer/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@

import pyarrow # type: ignore

import writer.workflows
from writer import core_ui
from writer.core_ui import Component
from writer.ss_types import (
Expand All @@ -56,8 +57,6 @@
WriterFileItem,
)

import writer.workflows

if TYPE_CHECKING:
import pandas
import polars
Expand Down
4 changes: 3 additions & 1 deletion src/writer/workflows.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from typing import Dict, List, Tuple

import writer.core
import writer.workflows_blocks
from writer.core_ui import Component
import writer.core


def _get_workflow_nodes(component_id):
return writer.core.base_component_tree.get_descendents(component_id)
Expand Down
2 changes: 1 addition & 1 deletion src/writer/workflows_blocks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from writer.workflows_blocks.httprequest import HTTPRequest
from writer.workflows_blocks.runworkflow import RunWorkflow
from writer.workflows_blocks.setstate import SetState
from writer.workflows_blocks.writerclassification import WriterClassification
from writer.workflows_blocks.writercompletion import WriterCompletion
from writer.workflows_blocks.runworkflow import RunWorkflow

SetState.register("workflows_setstate")
WriterClassification.register("workflows_writerclassification")
Expand Down
7 changes: 4 additions & 3 deletions src/writer/workflows_blocks/blocks.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from typing import Dict
from writer.ss_types import InstancePath
import writer.workflows_blocks
from typing import Dict

import writer.core
import writer.core_ui
import writer.workflows_blocks
from writer.ss_types import InstancePath

block_map = {}

Expand Down
5 changes: 3 additions & 2 deletions src/writer/workflows_blocks/foreach.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import writer.workflows
from writer.abstract import register_abstract_template
from writer.ss_types import AbstractTemplate
from writer.workflows_blocks.blocks import WorkflowBlock
import writer.workflows


class ForEach(WorkflowBlock):

Expand Down Expand Up @@ -59,6 +60,6 @@ def run(self):
for item in items:
writer.workflows.run_workflow_by_key(self.session, workflow_key)
self.outcome = "success"
except Exception as e:
except Exception:
self.result = "HTTP call failed."
self.outcome = "connectionError"
2 changes: 2 additions & 0 deletions src/writer/workflows_blocks/httprequest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import requests

from writer.abstract import register_abstract_template
from writer.ss_types import AbstractTemplate
from writer.workflows_blocks.blocks import WorkflowBlock


class HTTPRequest(WorkflowBlock):

@classmethod
Expand Down
3 changes: 2 additions & 1 deletion src/writer/workflows_blocks/runworkflow.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import writer.workflows
from writer.abstract import register_abstract_template
from writer.ss_types import AbstractTemplate
from writer.workflows_blocks.blocks import WorkflowBlock
import writer.workflows


class RunWorkflow(WorkflowBlock):

Expand Down
3 changes: 2 additions & 1 deletion src/writer/workflows_blocks/setstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from writer.ss_types import AbstractTemplate
from writer.workflows_blocks.blocks import WorkflowBlock


class SetState(WorkflowBlock):

@classmethod
Expand Down Expand Up @@ -45,5 +46,5 @@ def run(self):
try:
self.evaluator.set_state(element, self.instance_path, value)
self.outcome = "success"
except Exception as e:
except Exception:
self.outcome = "error"
1 change: 1 addition & 0 deletions src/writer/workflows_blocks/writerclassification.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import json

from writer.abstract import register_abstract_template
from writer.ss_types import AbstractTemplate
from writer.workflows_blocks.blocks import WorkflowBlock
Expand Down
1 change: 1 addition & 0 deletions src/writer/workflows_blocks/writercompletion.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from writer.ss_types import AbstractTemplate
from writer.workflows_blocks.blocks import WorkflowBlock


class WriterCompletion(WorkflowBlock):

@classmethod
Expand Down

0 comments on commit 3c00960

Please sign in to comment.