Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor sql generation to use new parser #104

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
REQUIREMENTS := $(shell find . -name 'pyproject.toml')
ENVIRONMENT := $(shell find . -name 'environment.yml')
SHELL := /bin/bash
CONDA_PREFIX ?= venv
CONDA_PREFIX := venv
VIRTUAL_ENV ?= $(CONDA_PREFIX)
PYTHON_MODULES := $(shell find . -name '*.py')
DOCKER_COMPOSE := $(shell which docker-compose)
Expand Down
2 changes: 0 additions & 2 deletions cannula/codegen/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from .codegen import render_code, render_file
from .parse import parse_schema

# from ..types import Argument, Directive, Field, FieldType, ObjectType

__all__ = [
"parse_schema",
"render_code",
"render_file",
]
14 changes: 0 additions & 14 deletions cannula/codegen/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,3 @@ def ast_for_class_field(field: Field) -> ast.AnnAssign:
return ast_for_annotation_assignment(
field.name, annotation=field_type, default=default
)


def fix_missing_locations(node: ast.Module) -> ast.Module:
"""Add missing line numbers and column offsets to the AST."""
for child in ast.walk(node):
if not hasattr(child, "lineno"):
child.lineno = 1 # type: ignore
if not hasattr(child, "col_offset"):
child.col_offset = 0 # type: ignore
if not hasattr(child, "end_lineno"):
child.end_lineno = 1 # type: ignore
if not hasattr(child, "end_col_offset"):
child.end_col_offset = 0 # type: ignore
return node
Loading