From 527c99385b7ea99db15ff82e77d2fad2fee3ce51 Mon Sep 17 00:00:00 2001 From: Yohe-Am <56622350+Yohe-Am@users.noreply.github.com> Date: Wed, 15 Jan 2025 06:45:29 +0100 Subject: [PATCH] fix: merge issues --- src/typegate/src/runtimes/deno/deno.ts | 6 +++--- .../src/runtimes/patterns/worker_manager/deno.ts | 1 + .../substantial/workflow_worker_manager.ts | 4 ++-- tests/internal/py/logic_types.py | 14 ++++++-------- tests/sync/sync_force_remove_test.ts | 5 ++--- tools/list-duplicates.ts | 4 +--- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/typegate/src/runtimes/deno/deno.ts b/src/typegate/src/runtimes/deno/deno.ts index ca08062e5..4246a2c22 100644 --- a/src/typegate/src/runtimes/deno/deno.ts +++ b/src/typegate/src/runtimes/deno/deno.ts @@ -119,7 +119,7 @@ export class DenoRuntime extends Runtime { const ops = new Map(); const uuid = crypto.randomUUID(); - const basePath = path.join(typegate.config.base.tmp_dir, "artifacts"); + const _basePath = path.join(typegate.config.base.tmp_dir, "artifacts"); let registryCount = 0; for (const mat of materializers) { @@ -248,8 +248,8 @@ export class DenoRuntime extends Runtime { delegate( mat: TypeMaterializer, - verbose: boolean, - pulseCount?: number, + _verbose: boolean, + _pulseCount?: number, ): Resolver { if (mat.name === "predefined_function") { const func = predefinedFuncs[mat.data.name as string]; diff --git a/src/typegate/src/runtimes/patterns/worker_manager/deno.ts b/src/typegate/src/runtimes/patterns/worker_manager/deno.ts index b2ec55179..1c6920df3 100644 --- a/src/typegate/src/runtimes/patterns/worker_manager/deno.ts +++ b/src/typegate/src/runtimes/patterns/worker_manager/deno.ts @@ -32,6 +32,7 @@ export class DenoWorker write: false, ffi: false, env: envSharedWithWorkers, + import: true, }, }, }); diff --git a/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts b/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts index d6176dc30..2b99a5f1d 100644 --- a/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts +++ b/src/typegate/src/runtimes/substantial/workflow_worker_manager.ts @@ -27,11 +27,11 @@ export class WorkerManager }); } - destroyWorker(name: string, runId: string) { + override destroyWorker(name: string, runId: string) { return super.destroyWorker(name, runId); } - destroyAllWorkers() { + override destroyAllWorkers() { logger.warn( `Destroying workers for ${ this diff --git a/tests/internal/py/logic_types.py b/tests/internal/py/logic_types.py index 8a7319b60..924a88681 100644 --- a/tests/internal/py/logic_types.py +++ b/tests/internal/py/logic_types.py @@ -87,15 +87,15 @@ def new(dt_class: Any, val: Any): @dataclass -class RootSumFnInput(Struct): +class StructC3ed7(Struct): first: float second: float -FORWARD_REFS["RootSumFnInput"] = RootSumFnInput +FORWARD_REFS["StructC3ed7"] = StructC3ed7 -TypeRootSumFnInputFirstFloat = float +TypeFloatB5e57 = float def __repr(value: Any): @@ -104,12 +104,10 @@ def __repr(value: Any): return value -def typed_remote_sum( - user_fn: Callable[[RootSumFnInput, Ctx], TypeRootSumFnInputFirstFloat], -): +def typed_remote_sum(user_fn: Callable[[StructC3ed7, Ctx], TypeFloatB5e57]): def exported_wrapper(raw_inp, ctx): - inp: RootSumFnInput = Struct.new(RootSumFnInput, raw_inp) - out: TypeRootSumFnInputFirstFloat = user_fn(inp, ctx) + inp: StructC3ed7 = Struct.new(StructC3ed7, raw_inp) + out: TypeFloatB5e57 = user_fn(inp, ctx) if isinstance(out, list): return [__repr(v) for v in out] return __repr(out) diff --git a/tests/sync/sync_force_remove_test.ts b/tests/sync/sync_force_remove_test.ts index 90126daf9..beb0b26af 100644 --- a/tests/sync/sync_force_remove_test.ts +++ b/tests/sync/sync_force_remove_test.ts @@ -1,7 +1,7 @@ // Copyright Metatype OÜ, licensed under the Mozilla Public License Version 2.0. // SPDX-License-Identifier: MPL-2.0 -import { gql, Meta } from "test-utils/mod.ts"; +import { Meta } from "test-utils/mod.ts"; import { connect } from "redis"; import { S3Client } from "aws-sdk/client-s3"; import { createBucket, listObjects, tryDeleteBucket } from "test-utils/s3.ts"; @@ -79,8 +79,7 @@ Meta.test( async () => { const _engine = await t.engine("sync/sync.py", { secrets: { - ULTRA_SECRET: - "if_you_can_read_me_on_an_ERROR_there_is_a_bug", + ULTRA_SECRET: "if_you_can_read_me_on_an_ERROR_there_is_a_bug", }, }); diff --git a/tools/list-duplicates.ts b/tools/list-duplicates.ts index 88d6e462b..fe5f0b207 100755 --- a/tools/list-duplicates.ts +++ b/tools/list-duplicates.ts @@ -12,7 +12,7 @@ * Default: 0 */ -import { cyan, green, objectHash, parseArgs, red } from "./deps.ts"; +import { green, objectHash, parseArgs, red } from "./deps.ts"; // FIXME: import from @metatype/typegate import type { TypeGraphDS } from "../src/typegate/src/typegraph/mod.ts"; import { visitType } from "../src/typegate/src/typegraph/visitor.ts"; @@ -380,8 +380,6 @@ for (const tg of tgs) { listDuplicatesEnhanced(tg, rootIdx); } -console.log({ whereTypeCount, optionalTypeCount }); - function argToInt(arg: string | undefined, defaultValue: number): number { const parsed = parseInt(arg ?? `${defaultValue}`); return isNaN(parsed) ? defaultValue : parsed;