-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Support for Pandas DataFrames #453
Comments
As a followup - looking at the implementation of |
YAML doesn't magically enable Pandas DataFrames. The default Python YAML library will (de)serialize arbitrary objects, but that's insecure, at least for deserialization (the safe_* variants won't do that for that reason). So I recommend against it. Some options:
|
"YAML doesn't magically enable Pandas DataFrames. The default Python YAML library will (de)serialize arbitrary objects, but that's insecure, at least for deserialization (the safe_* variants won't do that for that reason). So I recommend against it." agreed, I usually use the yamlable library to wrap any object that is meant to be serialized by yaml - however one can argue for purposes when all YAML objects are locally created by the user then this security issue is less of a concern when it comes to deserialization ... (re:yamlable:
|
Sorry I recognize this is probably a question better raised on ‘eliot-tree’ but if one uses a custom destination to a yaml file - would Eliot-tree also accept a custom deserializer ? |
Not sure, it's a different maintainer. FWIW I suggest option #1 is better: it'll Just Work with eliot-tree, and it's not very hard to do. Here's what the NumPy code looks like: https://github.com/itamarst/eliot/blob/master/eliot/json.py#L15 You'd just need to add another if statement or two there that converts a DataFrame/Series to Python objects. |
Thank you for open-sourcing the eliot logging library.
I have a question about the decision to use JSON to serialize the logs - specifically when it comes to scientific computing. Trying to use a pandas object as an argument results in
Object of type DataFrame is not JSON serializable
- however, had the choice been made to use YAML then this would not have been an issue.Can you shed some light on the necessity of using JSON vs YAML for eliot's purposes - and what do you think about using YAML instead?
The text was updated successfully, but these errors were encountered: