plaid/plaid-python

AttributeError: 'dict' object has no attribute '_composed_schemas'

hbradlow opened this issue · 3 comments

Our use of Plaid transactions started raising this error yesterday:

AttributeError: 'dict' object has no attribute '_composed_schemas'
  File "celery/app/trace.py", line 734, in __protected_call__
    return self.run(*args, **kwargs)
  File "contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "banking/tasks.py", line 282, in run_plaid_sync
    sync_bank_account(bank_account)
  File "reversion/revisions.py", line 325, in do_revision_context
    return func(*args, **kwargs)
  File "banking/adaptive_plaid/operations.py", line 174, in sync_bank_account
    serializer = PlaidTransactionDeserializer(data=plaid_transaction_data.to_dict())
  File "plaid/model_utils.py", line 520, in to_dict
    return model_to_dict(self, serialize=False)
  File "plaid/model_utils.py", line 1462, in model_to_dict
    result[attr] = [model_to_dict(x, serialize=serialize) for x in value]
  File "plaid/model_utils.py", line 1462, in <listcomp>
    result[attr] = [model_to_dict(x, serialize=serialize) for x in value]
  File "plaid/model_utils.py", line 1447, in model_to_dict
    if model_instance._composed_schemas:

Before yesterday we have used the plaid transactions product for ~6 months without encountering this error. Did something change in the API?

Setup:
Plaid-Python Version: 11.2.0
OS: Mac OS 13.3.1 (a)
Python Version: Python 3.9.6

I am also seeing this issue for the first time. I had no issues the last time I ran my script on September 21, 2023 using the setup above.

@jfantell I upgraded to plaid-python 16.0.0 and the problem went away. But it does seem like there was some breaking change in the API that caused this

This was caused by the release of personal finance categories (see https://plaid.com/docs/transactions/pfc-migration/), which is our new, more accurate categorization system for Transactions. This should not have been a breaking change, but apparently was for some older versions of plaid-python. We've since identified customers who are using older, incompatible versions of plaid-python and excluded them from this feature -- they can contact us to be re-enabled once they've upgraded their client library versions.