From 3c817f2b6939f0cd07e1f2bab7075984eef03500 Mon Sep 17 00:00:00 2001 From: Rushil Patel Date: Thu, 16 Jan 2025 07:19:27 -0800 Subject: [PATCH] fix: ruff --- src/codegen/cli/api/client.py | 8 ++++++-- src/codegen/cli/utils/json_schema.py | 13 +++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/codegen/cli/api/client.py b/src/codegen/cli/api/client.py index 7ae4d7d..b713c34 100644 --- a/src/codegen/cli/api/client.py +++ b/src/codegen/cli/api/client.py @@ -187,7 +187,11 @@ def identify(self) -> IdentifyResponse | None: IdentifyResponse, ) - def deploy(self, codemod_name: str, codemod_source: str, lint_mode: bool = False, lint_user_whitelist: list[str] | None = None, message: str | None = None, arguments_schema: dict | None = None) -> DeployResponse: + def deploy(self, codemod_name: str, + codemod_source: str, lint_mode: bool = False, + lint_user_whitelist: list[str] | None = None, + message: str | None = None, + arguments_schema: dict | None = None) -> DeployResponse: """Deploy a codemod to the Modal backend.""" session = CodegenSession() return self._make_request( @@ -195,7 +199,7 @@ def deploy(self, codemod_name: str, codemod_source: str, lint_mode: bool = False DEPLOY_ENDPOINT, DeployInput( input=DeployInput.BaseDeployInput( - codemod_name=codemod_name, codemod_source=codemod_source, repo_full_name=session.repo_name, lint_mode=lint_mode, lint_user_whitelist=lint_user_whitelist or [], message=message + codemod_name=codemod_name, codemod_source=codemod_source, repo_full_name=session.repo_name, lint_mode=lint_mode, lint_user_whitelist=lint_user_whitelist or [], message=message, arguments_schema=arguments_schema ) ), DeployResponse, diff --git a/src/codegen/cli/utils/json_schema.py b/src/codegen/cli/utils/json_schema.py index c91ce52..3b832e7 100644 --- a/src/codegen/cli/utils/json_schema.py +++ b/src/codegen/cli/utils/json_schema.py @@ -1,18 +1,15 @@ -# This utility contains functions for utilizing, transforming and validating JSON schemas generated by Pydantic models. - import json - from pydantic import BaseModel +from pathlib import Path +from tempfile import TemporaryDirectory +from datamodel_code_generator import DataModelType, InputFileType, generate + +# This utility contains functions for utilizing, transforming and validating JSON schemas generated by Pydantic models. def get_schema(model: BaseModel) -> dict: return model.model_json_schema() -from pathlib import Path -from tempfile import TemporaryDirectory - -from datamodel_code_generator import DataModelType, InputFileType, generate - def validate_json(schema: dict, json_data: str) -> bool: json_schema = json.dumps(schema)