Skip to content

Commit

Permalink
Updating runtime to heroku deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
jesuejunior committed Dec 14, 2020
1 parent ff7cd7a commit 26f7800
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions brandenburg/models/batch.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Standard library imports
from datetime import datetime
from typing import Tuple, List, Dict, Union, Set, Optional
from typing import List, Dict, Union, Optional

# Third party imports
from pydantic import BaseModel, PrivateAttr, Field, Json, validator, root_validator
from pydantic import BaseModel, PrivateAttr, Field, validator

# Local application imports
from brandenburg.config import settings
Expand Down Expand Up @@ -70,18 +70,18 @@ def __init__(self, **kwargs) -> None:
# import ipdb; ipdb.set_trace()
super().__init__(**kwargs)
NOW: datetime = datetime.now()
self._sdc_received_at = NOW.strftime("%y-%m-%d %I:%M:%S")
self._sdc_received_at = NOW.strftime("%y-%m-%d %H:%M:%S")
self._sdc_sequence = int(NOW.timestamp())

@validator("data", pre=True)
def data_validator(cls, value):
"""
"""
assert isinstance(value, list) == True
if len(value) > BATCH_LIMIT:
raise ValueError(f"Field data exceed {BATCH_LIMIT} records.")
if not len(value):
raise ValueError("Field data cannot be empty.")
if isinstance(value, list):
if len(value) > BATCH_LIMIT:
raise ValueError(f"Field data exceed {BATCH_LIMIT} records.")
if not len(value):
raise ValueError("Field data cannot be empty.")
return value

@validator("action", always=True)
Expand Down
2 changes: 1 addition & 1 deletion runtime.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python-3.7.6
python-3.7.9

0 comments on commit 26f7800

Please sign in to comment.