Skip to content

Commit

Permalink
fix flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xnuinside committed Oct 11, 2022
1 parent 1b445e3 commit d9a1921
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions omymodels/logic.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from typing import Dict, List

import omymodels.types as t


def generate_column(
column_data: Dict, table_pk: List[str], table_data: Dict, templates, obj
) -> str:
""" method to generate full column defention for sqlalchemy & gino ORM models """
"""method to generate full column defention for sqlalchemy & gino ORM models"""
column_type = t.prepare_column_type_orm(obj, column_data)
column = templates.column_template.format(
column_name=column_data.name, column_type=column_type
Expand Down Expand Up @@ -53,7 +54,6 @@ def setup_column_attributes(
if column_data.unique:
column += templates.unique


return column


Expand Down
7 changes: 4 additions & 3 deletions tests/functional/generator/test_gino_models.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os

from omymodels import create_models


Expand Down Expand Up @@ -296,7 +297,7 @@ class Products(db.Model):
ID = db.Column(db.Integer(), primary_key=True)
merchant_id = db.Column(db.Integer(), db.ForeignKey('merchants.id'), nullable=False)
"""

ddl = """
CREATE TABLE "merchants" (
"id" int PRIMARY KEY,
Expand All @@ -310,5 +311,5 @@ class Products(db.Model):
ALTER TABLE "products" ADD FOREIGN KEY ("merchant_id") REFERENCES "merchants" ("id");
"""
result = create_models(ddl, models_type='gino', no_auto_snake_case=True)['code']
assert expected == result
result = create_models(ddl, models_type="gino", no_auto_snake_case=True)["code"]
assert expected == result
4 changes: 2 additions & 2 deletions tests/functional/generator/test_sqlalchemy_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,5 @@ class Products(Base):
ALTER TABLE "products" ADD FOREIGN KEY ("merchant_id") REFERENCES "merchants" ("id");
"""
result = create_models(ddl, models_type='sqlalchemy')['code']
assert result == expected
result = create_models(ddl, models_type="sqlalchemy")["code"]
assert result == expected

0 comments on commit d9a1921

Please sign in to comment.