We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Describe the bug
When outputting Pandas dataframes with pd.Timestamp columns, the following exception is raised by E2B:
---------------------------------------------------------------------------TypeError Traceback (most recent call last)File /usr/local/lib/python3.10/site-packages/IPython/core/formatters.py:343, in BaseFormatter.__call__(self, obj) 341 pass 342 else: --> 343 return printer(obj) 344 # Finally look for special method names 345 method = get_real_method(obj, self.print_method) File ~/.ipython/profile_default/startup/0002_data.py:23, in _dataframe_repr_e2b_data_(self) 22 def _dataframe_repr_e2b_data_(self: pandas.DataFrame): ---> 23 return orjson.loads(orjson.dumps(self.to_dict(orient="list"))) TypeError: Type is not JSON serializable: Timestamp"
To Reproduce Run the following code in a code interpreter sandbox:
# Get social accounts (with timestamp field) df = pd.DataFrame({'timestamp': [pd.Timestamp('2024-01-01T00:00:00Z')], 'name': ['John Smith']}) print(df) display(df)
Expected behavior
It should not fail to convert the timestamp fields into a string representation in JSON.
Versions
e2b: 1.0.5 e2b-code-interpreter: 1.0.3
The text was updated successfully, but these errors were encountered:
E2B-1325 "TypeError: Type is not JSON serializable: Timestamp" when outputting Dataframe with pd.Timestamp column in Code Interpreter
Sorry, something went wrong.
Hi folks, happy new year! Any update on this issue? Thanks!
jakubno
No branches or pull requests
Describe the bug
When outputting Pandas dataframes with pd.Timestamp columns, the following exception is raised by E2B:
To Reproduce
Run the following code in a code interpreter sandbox:
Expected behavior
It should not fail to convert the timestamp fields into a string representation in JSON.
Versions
e2b: 1.0.5
e2b-code-interpreter: 1.0.3
The text was updated successfully, but these errors were encountered: