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

Fix arrow python type #765

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions sqlalchemy_utils/types/arrow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from arrow import Arrow
from ..exceptions import ImproperlyConfigured
from .enriched_datetime import ArrowDateTime
from .enriched_datetime.enriched_datetime_type import EnrichedDateTimeType
Expand Down Expand Up @@ -47,16 +48,15 @@ class Article(Base):
# 'an hour ago'

"""

cache_ok = True

def __init__(self, *args, **kwargs):
if not arrow:
raise ImproperlyConfigured(
"'arrow' package is required to use 'ArrowType'"
)

super().__init__(
datetime_processor=ArrowDateTime,
*args,
**kwargs
)
raise ImproperlyConfigured("'arrow' package is required to use 'ArrowType'")

super().__init__(datetime_processor=ArrowDateTime, *args, **kwargs)

@property
def python_type(self):
return Arrow