From 4d44c7eaff2cd97060f1887a60740dcb19f64a32 Mon Sep 17 00:00:00 2001 From: g Date: Thu, 15 Feb 2024 17:45:50 -0700 Subject: [PATCH] chore: build errors and linting --- .../dynamic-size-input-template.tsx | 2 +- frontend/app/src/components/ui/json-form.tsx | 23 ++++--------------- .../$run/components/step-run-playground.tsx | 2 +- .../pages/main/workflow-runs/$run/index.tsx | 2 -- python-sdk/examples/manual_trigger/worker.py | 20 +++++++++++++++- 5 files changed, 25 insertions(+), 24 deletions(-) diff --git a/frontend/app/src/components/ui/form-inputs/dynamic-size-input-template.tsx b/frontend/app/src/components/ui/form-inputs/dynamic-size-input-template.tsx index 845aace9b..274f3f08e 100644 --- a/frontend/app/src/components/ui/form-inputs/dynamic-size-input-template.tsx +++ b/frontend/app/src/components/ui/form-inputs/dynamic-size-input-template.tsx @@ -64,7 +64,7 @@ export function DynamicSizeInputTemplate(props: BaseInputTemplateProps) { return; } setHeight(ref.current); - }, [ref.current, ref.current?.value]); + }, [ref.current?.value]); const handleKeyDown = (e: KeyboardEvent) => { if (!form?.current) { diff --git a/frontend/app/src/components/ui/json-form.tsx b/frontend/app/src/components/ui/json-form.tsx index 997aa7109..79017ebd6 100644 --- a/frontend/app/src/components/ui/json-form.tsx +++ b/frontend/app/src/components/ui/json-form.tsx @@ -1,8 +1,5 @@ import { cn } from '@/lib/utils'; import { - CustomValidator, - ErrorSchema, - ErrorTransformer, RJSFSchema, RJSFValidationError, UiSchema, @@ -23,31 +20,19 @@ type JSONType = { [key: string]: JSONType | JSONPrimitive }; export const DEFAULT_COLLAPSED = ['advanced', 'user data']; class NoValidation implements ValidatorType { - validateFormData( - formData: any, - schema: RJSFSchema, - customValidate?: CustomValidator | undefined, - transformErrors?: ErrorTransformer | undefined, - uiSchema?: UiSchema | undefined, - ): ValidationData { + validateFormData(): ValidationData { return { errors: [], errorSchema: {} }; } - toErrorList( - errorSchema?: ErrorSchema | undefined, - fieldPath?: string[] | undefined, - ): RJSFValidationError[] { + toErrorList(): RJSFValidationError[] { return []; } - isValid(schema: RJSFSchema, formData: any, rootSchema: RJSFSchema): boolean { + isValid(): boolean { return true; } - rawValidation( - schema: RJSFSchema, - formData?: any, - ): { errors?: Result[] | undefined; validationError?: Error | undefined } { + rawValidation() { return {}; } } diff --git a/frontend/app/src/pages/main/workflow-runs/$run/components/step-run-playground.tsx b/frontend/app/src/pages/main/workflow-runs/$run/components/step-run-playground.tsx index 139d98bc0..3269acd2b 100644 --- a/frontend/app/src/pages/main/workflow-runs/$run/components/step-run-playground.tsx +++ b/frontend/app/src/pages/main/workflow-runs/$run/components/step-run-playground.tsx @@ -76,7 +76,7 @@ export function StepRunPlayground({ ); return modifiedInput; - }, [stepRun?.input, workflowRun?.jobRuns]); + }, [stepRun?.input, workflowRun]); const [stepInput, setStepInput] = useState(originalInput); diff --git a/frontend/app/src/pages/main/workflow-runs/$run/index.tsx b/frontend/app/src/pages/main/workflow-runs/$run/index.tsx index 46d27043d..1f8f3db4c 100644 --- a/frontend/app/src/pages/main/workflow-runs/$run/index.tsx +++ b/frontend/app/src/pages/main/workflow-runs/$run/index.tsx @@ -6,8 +6,6 @@ import { Link, useOutletContext, useParams } from 'react-router-dom'; import invariant from 'tiny-invariant'; import { Badge } from '@/components/ui/badge'; import { relativeDate, timeBetween } from '@/lib/utils'; -import { ArrowLeftCircleIcon } from '@heroicons/react/24/outline'; -import { Button } from '@/components/ui/button'; import { CodeEditor } from '@/components/ui/code-editor'; import { Loading } from '@/components/ui/loading.tsx'; import { TenantContextType } from '@/lib/outlet'; diff --git a/python-sdk/examples/manual_trigger/worker.py b/python-sdk/examples/manual_trigger/worker.py index 690ee5f01..0d1f21821 100644 --- a/python-sdk/examples/manual_trigger/worker.py +++ b/python-sdk/examples/manual_trigger/worker.py @@ -10,8 +10,11 @@ hatchet = Hatchet(debug=True) class ManualTriggerWorkflow: @hatchet.step() def step1(self, context): + res = context.overrides('res', "HELLO") + + context.sleep(3) print("executed step1") - return {"step1": "data1"} + return {"step1": "data1 "+res} @hatchet.step(parents=["step1"], timeout='4s') def step2(self, context): @@ -20,6 +23,21 @@ class ManualTriggerWorkflow: print("finished step2") return {"step2": "data2"} + # @hatchet.step() + # def stepb(self, context): + # res = context.overrides('res', "HELLO") + + # context.sleep(3) + # print("executed step1") + # return {"step1": "data1 "+res} + + # @hatchet.step(parents=["stepb"], timeout='4s') + # def stepc(self, context): + # print("started step2") + # context.sleep(1) + # print("finished step2") + # return {"step2": "data2"} + workflow = ManualTriggerWorkflow() worker = hatchet.worker('manual-worker', max_threads=4)