Skip to content

Commit

Permalink
cambio filter por list comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
lrromero committed Apr 15, 2019
1 parent b747ab4 commit 539342c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pydatajson/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ def validate_catalog(catalog, only_errors=False, fmt="dict",

# filtra los resultados que están ok, para hacerlo más compacto
if only_errors:
response["error"]["dataset"] = filter(
lambda dataset: dataset["status"] == "ERROR",
response["error"]["dataset"]
)
response["error"]["dataset"] = [
dataset for dataset in response["error"]["dataset"] if
dataset["status"] == "ERROR"]

# elige el formato del resultado
if export_path:
Expand Down

0 comments on commit 539342c

Please sign in to comment.