Skip to content

Commit

Permalink
empty check
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmonteiro committed Jun 18, 2024
1 parent 4190ef1 commit 8c6301c
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,15 +372,22 @@ def run(argv):
"mimetype":"application/json",\
".content":output_str})\
])

outDf = outDf.with_columns(pl.col('.ci').cast(pl.Int32))\
.with_columns(pl.col('status').cast(pl.Float64))
outDf2 = outDf2.with_columns(pl.col('.ci').cast(pl.Int32))\
.with_columns(pl.col('.content').cast(pl.Utf8))

outDf = tercenCtx.add_namespace(outDf)
outDf2 = tercenCtx.add_namespace(outDf2)
tercenCtx.save([outDf, outDf2])

dfArray = []
if not outDf.is_empty():
outDf = outDf.with_columns(pl.col('.ci').cast(pl.Int32))\
.with_columns(pl.col('status').cast(pl.Float64))
outDf = tercenCtx.add_namespace(outDf)
dfArray.append(outDf)

if not outDf2.is_empty():
outDf2 = outDf2.with_columns(pl.col('.ci').cast(pl.Int32))\
.with_columns(pl.col('.content').cast(pl.Utf8))
outDf2 = tercenCtx.add_namespace(outDf2)
dfArray.append(outDf2)

if len(dfArray) > 0:
tercenCtx.save(dfArray)

else:
run_with_params(params)
Expand Down

0 comments on commit 8c6301c

Please sign in to comment.