Skip to content

Commit

Permalink
Merge pull request #254 from cal-itp/fix-file-presence
Browse files Browse the repository at this point in the history
try to work around mutate resulting in nans
  • Loading branch information
charlie-costanzo authored May 18, 2023
2 parents 79804af + 582e7fc commit 8dba33c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions reports/generate_reports_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from calitp_data_analysis.sql import get_engine # type: ignore
from siuba import _, arrange, collect # type: ignore
from siuba import filter as filtr # type: ignore
from siuba import if_else, mutate, pipe, rename, select, spread # type: ignore
from siuba import mutate, pipe, rename, select, spread # type: ignore
from siuba.sql import LazyTbl # type: ignore
from tqdm import tqdm

Expand Down Expand Up @@ -149,8 +149,14 @@ def generate_file_check(itp_id: int, publish_date):
>> rename(success=_.file_present)
>> rename(name=_.filename)
>> rename(category=_.reason)
)

file_check.success = file_check.success.apply(lambda v: "✅" if v else "")
# replacing this in mutate call
# success=if_else(_.success == True, "✅", ""), # noqa: E712
file_check = (
file_check
>> mutate(
success=if_else(_.success == True, "✅", ""), # noqa: E712
date_checked=_.date_checked.astype(str),
)
>> spread(_.date_checked, _.success)
Expand Down
2 changes: 1 addition & 1 deletion tests/schemas/schema_1_feed_info.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"no_service_days_ct": {
"anyOf": [
{
"type": "integer"
"type": "number"
},
{
"type": "null"
Expand Down

0 comments on commit 8dba33c

Please sign in to comment.