Skip to content

Commit 9cb6b9e

Browse files
author
Sean Sullivan
committed
Fix lint
1 parent ce596cb commit 9cb6b9e

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

elastic_datashader/parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
from elasticsearch import Elasticsearch
1313
from elasticsearch.exceptions import NotFoundError, ConflictError
1414
from elasticsearch_dsl import Document
15+
from pydantic import BaseModel, Field
1516

1617
from .config import config
1718
from .elastic import get_search_base, build_dsl_filter
1819
from .logger import logger
1920
from .timeutil import quantize_time_range, convert_kibana_time
2021

21-
from pydantic import BaseModel, Field
2222

2323
class SearchParams(BaseModel):
2424
geopoint_field: str

elastic_datashader/routers/tms.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,16 @@ def generate_tile_to_cache(idx: str, x: int, y: int, z: int, params, parameter_h
282282
logger.debug("Releasing cache placeholder %s", rendering_tile_name(idx, x, y, z, parameter_hash))
283283
release_cache_placeholder(config.cache_path, rendering_tile_name(idx, x, y, z, parameter_hash))
284284

285-
async def fetch_or_render_tile(already_waited: int, idx: str, x: int, y: int, z: int, request: Request, background_tasks: BackgroundTasks, post_params={}):
285+
async def fetch_or_render_tile(already_waited: int, idx: str, x: int, y: int, z: int, request: Request, background_tasks: BackgroundTasks, post_params=None):
286286
check_proxy_key(request.headers.get('tms-proxy-key'))
287287

288288
es = Elasticsearch(
289289
config.elastic_hosts.split(","),
290290
verify_certs=False,
291291
timeout=120,
292292
)
293-
293+
if post_params is None:
294+
post_params = {}
294295
# Get hash and parameters
295296
try:
296297
print(request.query_params)
@@ -355,10 +356,10 @@ async def post_tile(already_waited: int, idx: str, x: int, y: int, z: int, reque
355356
params["params"] = json.dumps(params["params"])
356357
response = await fetch_or_render_tile(0, idx, x, y, z, request, background_tasks, post_params=params)
357358
if isinstance(response, RedirectResponse):
358-
print(response.headers)
359+
print(already_waited)
359360
return JSONResponse(status_code=200, content={"retry-after": response.headers['retry-after']})
360361
return response
361-
362+
362363

363364

364-
365+

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ localwebserver = ["uvicorn"]
5757

5858
[tool.pylint.'MESSAGES CONTROL']
5959
max-line-length = 150
60+
extension-pkg-whitelist=pydantic
6061
disable = "too-many-nested-blocks,too-many-branches,too-many-statements,R0801,R0902,R0903,R0911,R0913,R0914,C0103,C0114,C0115,C0116,C0123,C0301,C0302,fixme"
6162

6263
[tool.black]

0 commit comments

Comments
 (0)