Skip to content

Commit

Permalink
Merge pull request #581 from wri/develop
Browse files Browse the repository at this point in the history
staging -> production: version metadata fix and vector tile cache layer name fix
  • Loading branch information
dmannarino authored Aug 28, 2024
2 parents 0fb62e6 + 17112fe commit c93189f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit c93189f

Please sign in to comment.