Closed joelittlejohn closed 4 years ago
I originally planned to do two things here:
Whilst deciding how to phrase the message, I found it hard to justify to myself that lazy sequences that have been realized should still be rejected, so I ended up changing tack. I have improved the error message a lot for sequences that must be rejected. I do believe it's still right to reject sequences that could potentially be infinite.
Re including the 'path' to the data in the error message, I didn't end up attempting this because it required too much change all over the code base. Hopefully with a better description of the problem it will be more clear what to look for to solve it.
Until now, including a lazy sequence in item data when serializing would result in an error like:
This is a common failure scenario for new users of Faraday since we tend to create lazy sequences often when transforming data. There's discussion about what Faraday should do with these sequence here: https://github.com/Taoensso/faraday/issues/99.
This change allows a lazy sequence to be serialized and written as long as it has been realized. This seemed like the best compromise.
Closes #99