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

staging -> production: version metadata fix and vector tile cache layer name fix #581

Merged
merged 7 commits into from
Aug 28, 2024
7 changes: 5 additions & 2 deletions app/models/pydantic/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from typing import Any, List, Optional, Union
from uuid import UUID

from fastapi import HTTPException
from pydantic import Field, validator, BaseModel
from pydantic.utils import GetterDict

Expand Down Expand Up @@ -176,10 +177,12 @@ class VersionMetadataWithParentResponse(Response):


def _date_validator(date_str):
if isinstance(date_str, date):
if isinstance(date_str, date) or date_str is None:
return date_str

try:
return datetime.strptime(date_str, "%Y-%m-%d").date()
except (ValueError, TypeError):
return None
raise HTTPException(
status_code=422, detail="Date needs to be of the format YYYY-MM-DD"
)
3 changes: 2 additions & 1 deletion batch/scripts/create_vector_tile_cache.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ME=$(basename "$0")
. get_arguments.sh "$@"


NDJSON_FILE="data.json"
NDJSON_FILE="${DATASET}.json"

# Build an array of arguments to pass to tippecanoe
TIPPE_ARG_ARRAY=(
Expand All @@ -28,6 +28,7 @@ TIPPE_ARG_ARRAY=(
"--preserve-input-order"
"-P"
"-n" "${DATASET}"
"-l" "${DATASET}"
)

case ${TILE_STRATEGY} in
Expand Down
Loading