Skip to content

Commit

Permalink
cleanup of apply and unpack (#5626)
Browse files Browse the repository at this point in the history
* cleanup of apply and unpack

* Update public/pathway/python/pathway/internals/expression.py

* Update public/pathway/python/pathway/internals/expression.py

* Update public/pathway/python/pathway/internals/expression.py

* Update public/pathway/python/pathway/internals/expression.py

GitOrigin-RevId: e3af24d480f25f3aaf31f9422a162f68d9e44828
  • Loading branch information
izulin authored and Manul from Pathway committed Feb 8, 2024
1 parent 1da6e11 commit 5a614a5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions examples/pipelines/unstructured_to_sql_on_the_fly/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@
could be a nice next step to detect and possibly correct outliers.
"""

import json
import logging
import os
Expand Down Expand Up @@ -234,11 +235,10 @@ def structure_on_the_fly(

responses = responses.select(values=parse_str_to_list(pw.this.result))
result = unpack_col(responses.values, *sorted(FinancialStatementSchema.keys()))
result = result.select(
*pw.this.without(pw.this.eps, pw.this.net_income_md, pw.this.revenue_md),
eps=pw.apply_with_type(float, float, pw.this.eps),
net_income_md=pw.apply_with_type(float, float, pw.this.net_income_md),
revenue_md=pw.apply_with_type(float, float, pw.this.revenue_md),
result = result.with_columns(
eps=pw.apply(float, pw.this.eps),
net_income_md=pw.apply(float, pw.this.net_income_md),
revenue_md=pw.apply(float, pw.this.revenue_md),
)
return result

Expand Down

0 comments on commit 5a614a5

Please sign in to comment.