3

I have a <pandas.io.formats.style.Styler object at 0x7f29e1969430>.

I need to return this data through a return function, but I get this error:

'ERROR - Can't pickle local object 'Styler.applymap.<locals>.<lambda>'

I don't know what's the meaning of that sentence.

Tha's the code I trying to pass in a return function:

def dag_transform_data(**kwargs):
    charges = kwargs["ti"].xcom_pull("get_charges_report")
    active_payments = kwargs["ti"].xcom_pull("get_active_payments_report")
    return_payments = kwargs["ti"].xcom_pull("get_return_payments_report")
    return transform_data(charges, active_payments, return_payments)

This function returns <pandas.io.formats.style.Styler object at 0x7f29e1969430>.

Any solution?

Thanks in advance.

Henry Ecker
  • 34,399
  • 18
  • 41
  • 57
  • 2
    Try [this](https://stackoverflow.com/questions/30499341/establishing-why-an-object-cant-be-pickled) for info. Essentially classes cannot be pickled - only more simple objects. Pickling is a object applied to an object to pass it between processes as a byte string. – forgetso Jul 20 '20 at 19:42
  • If you're asking for a solution, please include a minimally reproducible example - including the (minimal) code that creates this issue. – Roy2012 Jul 20 '20 at 19:44
  • @Roy2012, yes, sorry, I added it. – Stiven Ramírez Arango Jul 20 '20 at 19:59
  • It's still not a minimal reproducible example. I don't know how to call this function, and transform_data isn't defined. It the issue is with Styler, maybe all you need for an MRE is to create such a styler and try to pickle it? – Roy2012 Jul 21 '20 at 04:45

0 Answers0