Remplementado deteccion de género en base a datos del INE de España

This commit is contained in:
2022-07-19 18:23:00 -03:00
parent 504698c98d
commit ae79c296c5
4 changed files with 34 additions and 9 deletions

View File

@ -25,7 +25,7 @@ def handle(req):
"""handle a request to the function
Args:
req (str): request body
[nombre1, nombre2, ... nombreN]
"""
@ -53,10 +53,10 @@ def handle(req):
WHERE nombre = :nombre
ORDER BY anio
"""
cursor.execute(sql,{"nombre": nombre})
cursor.execute(sql, {"nombre": nombre})
datos.update({r["anio"]: r["contador"] for r in cursor.fetchall()})
chart.add(nombre.title(), [datos[x] for x in range(1922, 2015)])
chart.x_labels = [str(n) for n in range(1922, 2015)]
chart.x_labels_major = [str(n) for n in range(1920, 2020, 10)]

View File

@ -5,6 +5,7 @@ from .handler import handle
# To disable testing, you can set the build_arg `TEST_ENABLED=false` on the CLI or in your stack.yml
# https://docs.openfaas.com/reference/yaml/#function-build-args-build-args
def test_handle():
# assert handle("input") == "input"
pass