Skip to content

Commit

Permalink
fix: ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
rushilpatel0 committed Jan 16, 2025
1 parent 79c2cb5 commit 3c817f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
8 changes: 6 additions & 2 deletions src/codegen/cli/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,15 +187,19 @@ 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(
"POST",
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,
Expand Down
13 changes: 5 additions & 8 deletions src/codegen/cli/utils/json_schema.py
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 3c817f2

Please sign in to comment.