Skip to content

Commit

Permalink
fix(enriched_datetime): Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
torotil committed Oct 22, 2024
1 parent 675480a commit 6151a5a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion sqlalchemy_utils/types/arrow.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .enriched_datetime import ArrowDateTime as ArrowType
from .enriched_datetime import ArrowDateTime as ArrowType # noqa
2 changes: 1 addition & 1 deletion sqlalchemy_utils/types/enriched_datetime/arrow_datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

from sqlalchemy import types

from ..scalar_coercible import ScalarCoercible
from ...exceptions import ImproperlyConfigured
from ..scalar_coercible import ScalarCoercible

arrow = None
try:
Expand Down
3 changes: 1 addition & 2 deletions sqlalchemy_utils/types/enriched_datetime/pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from sqlalchemy import types

from ..scalar_coercible import ScalarCoercible
from ...exceptions import ImproperlyConfigured
from ..scalar_coercible import ScalarCoercible

pendulum = None
try:
Expand Down Expand Up @@ -42,7 +42,6 @@ def __init__(self, *args, **kwargs):
)
super().__init__(*args, **kwargs)


def _coerce(self, value):
if value is not None:
if isinstance(value, pendulum.DateTime):
Expand Down
4 changes: 2 additions & 2 deletions tests/types/test_enriched_datetime_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
except ImportError:
arrow = None


@pytest.fixture
def Article(Base):
class Article(Base):
Expand Down Expand Up @@ -71,8 +72,7 @@ def test_literal_param(self, session, Article):
@pytest.mark.usefixtures('postgresql_dsn')
def test_timezone(self, session, Article):
timezone = tz.gettz('Europe/Stockholm')
dt = arrow.get(datetime(2015, 1, 1, 15, 30, 45),
timezone)
dt = arrow.get(datetime(2015, 1, 1, 15, 30, 45), timezone)
article = Article(published_at=dt, published_at_dt=dt.datetime)

session.add(article)
Expand Down
1 change: 1 addition & 0 deletions tests/types/test_enriched_datetime_pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
except ImportError:
pendulum = None


@pytest.fixture
def User(Base):
class User(Base):
Expand Down

0 comments on commit 6151a5a

Please sign in to comment.