Skip to content

Commit

Permalink
fix: merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Yohe-Am committed Jan 15, 2025
1 parent 3fe222a commit 527c993
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/typegate/src/runtimes/deno/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export class DenoRuntime extends Runtime {
const ops = new Map<number, Task>();

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) {
Expand Down Expand Up @@ -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];
Expand Down
1 change: 1 addition & 0 deletions src/typegate/src/runtimes/patterns/worker_manager/deno.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export class DenoWorker<M extends BaseMessage, E extends BaseDenoWorkerMessage>
write: false,
ffi: false,
env: envSharedWithWorkers,
import: true,
},
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 6 additions & 8 deletions tests/internal/py/logic_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down
5 changes: 2 additions & 3 deletions tests/sync/sync_force_remove_test.ts
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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",
},
});

Expand Down
4 changes: 1 addition & 3 deletions tools/list-duplicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 527c993

Please sign in to comment.