Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Removed unused imports
Removed commented out unused paramers
Sorted imports
  • Loading branch information
circulon committed Dec 1, 2024
1 parent e9008ae commit 3970262
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 23 deletions.
4 changes: 2 additions & 2 deletions src/masoniteorm/query/QueryBuilder.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import inspect
from copy import deepcopy
from datetime import datetime
from typing import Any, Dict, List, Optional, Callable
from typing import Any, Callable, Dict, List, Optional

from ..collection.Collection import Collection
from ..config import load_config
from ..exceptions import (
HTTP404,
ConnectionNotRegistered,
InvalidArgument,
ModelNotFound,
MultipleRecordsFound,
InvalidArgument,
)
from ..expressions.expressions import (
AggregateExpression,
Expand Down
6 changes: 3 additions & 3 deletions src/masoniteorm/query/grammars/BaseGrammar.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import re

from ...expressions.expressions import (
SubGroupExpression,
SubSelectExpression,
SelectExpression,
JoinClause,
OnClause,
SelectExpression,
SubGroupExpression,
SubSelectExpression,
)


Expand Down
3 changes: 2 additions & 1 deletion src/masoniteorm/query/grammars/PostgresGrammar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .BaseGrammar import BaseGrammar
import re

from .BaseGrammar import BaseGrammar


class PostgresGrammar(BaseGrammar):
"""Postgres grammar class."""
Expand Down
3 changes: 2 additions & 1 deletion src/masoniteorm/query/grammars/SQLiteGrammar.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .BaseGrammar import BaseGrammar
import re

from .BaseGrammar import BaseGrammar


class SQLiteGrammar(BaseGrammar):
"""SQLite grammar class."""
Expand Down
6 changes: 3 additions & 3 deletions src/masoniteorm/query/grammars/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .SQLiteGrammar import SQLiteGrammar
from .PostgresGrammar import PostgresGrammar
from .MySQLGrammar import MySQLGrammar
from .MSSQLGrammar import MSSQLGrammar
from .MySQLGrammar import MySQLGrammar
from .PostgresGrammar import PostgresGrammar
from .SQLiteGrammar import SQLiteGrammar
2 changes: 1 addition & 1 deletion src/masoniteorm/query/processors/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from .MSSQLPostProcessor import MSSQLPostProcessor
from .MySQLPostProcessor import MySQLPostProcessor
from .PostgresPostProcessor import PostgresPostProcessor
from .SQLitePostProcessor import SQLitePostProcessor
from .MSSQLPostProcessor import MSSQLPostProcessor
1 change: 0 additions & 1 deletion tests/postgres/builder/test_postgres_transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ def get_builder(self, table="users"):
grammar=PostgresGrammar,
connection=connection,
table=table,
# model=User,
connection_details=DATABASES,
).on("postgres")

Expand Down
3 changes: 0 additions & 3 deletions tests/sqlite/builder/test_sqlite_builder_insert.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from src.masoniteorm.models import Model
from src.masoniteorm.query import QueryBuilder
from src.masoniteorm.query.grammars import SQLiteGrammar
from src.masoniteorm.relationships import belongs_to
from tests.utils import MockConnectionFactory


class User(Model):
Expand All @@ -26,7 +24,6 @@ def get_builder(self, table="users"):
connection_class=connection,
connection="dev",
table=table,
# model=User,
connection_details=DATABASES,
).on("dev")

Expand Down
2 changes: 0 additions & 2 deletions tests/sqlite/builder/test_sqlite_builder_pagination.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from src.masoniteorm.models import Model
from src.masoniteorm.query import QueryBuilder
from src.masoniteorm.query.grammars import SQLiteGrammar
from src.masoniteorm.relationships import belongs_to
from tests.utils import MockConnectionFactory


class User(Model):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from src.masoniteorm.query import QueryBuilder
from src.masoniteorm.query.grammars import SQLiteGrammar
from src.masoniteorm.relationships import belongs_to, has_many
from tests.utils import MockConnectionFactory


class Logo(Model):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import inspect
import unittest

from src.masoniteorm.connections import ConnectionFactory
from src.masoniteorm.models import Model
from src.masoniteorm.query import QueryBuilder
from src.masoniteorm.query.grammars import SQLiteGrammar
Expand Down
3 changes: 0 additions & 3 deletions tests/sqlite/builder/test_sqlite_transaction.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import inspect
import unittest

from tests.integrations.config.database import DATABASES
from src.masoniteorm.connections import ConnectionFactory
from src.masoniteorm.models import Model
from src.masoniteorm.query import QueryBuilder
from src.masoniteorm.query.grammars import SQLiteGrammar
from src.masoniteorm.relationships import belongs_to
from tests.utils import MockConnectionFactory
from tests.integrations.config.database import DB
from src.masoniteorm.collection import Collection

Expand Down

0 comments on commit 3970262

Please sign in to comment.