Skip to content
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

Loggin chart and other media logs exception but fails silently without context #1526

Open
polyaxon-team opened this issue Jan 18, 2023 · 0 comments

Comments

@polyaxon-team
Copy link
Contributor

polyaxon-team commented Jan 18, 2023

Describe the bug

For example logging the following chart :

import plotly.express as px

from polyaxon import tracking

tracking.init(project="demo", is_new=True, tags=["examples"])

df = px.data.tips()
fig = px.density_heatmap(df, x="total_bill", y="tip", facet_row="sex", facet_col="smoker")
tracking.log_plotly_chart(name="2d-hist", figure=fig)

Would work if both plotly and matplotlib are installed, but if matplotlib is not installed it will raise the following error:

plotly is required for this tracking operation!
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "~/.virtualenvs/plx/lib/python3.9/site-packages/traceml/serialization/writer.py", line 124, in close
    self._event_writer.flush()
  File "~/.virtualenvs/plx/lib/python3.9/site-packages/traceml/serialization/base.py", line 82, in flush
    self._append_events(events_spec)
  File "~/.virtualenvs/plx/lib/python3.9/site-packages/traceml/serialization/base.py", line 58, in _append_events
    event_file.write(events_spec.get_csv_events())
  File "~/.virtualenvs/plx/lib/python3.9/site-packages/traceml/events/schemas.py", line 553, in get_csv_events
    events = ["\n{}".format(e.to_csv()) for e in self.events]
  File "~/.virtualenvs/plx/lib/python3.9/site-packages/traceml/events/schemas.py", line 553, in <listcomp>
    events = ["\n{}".format(e.to_csv()) for e in self.events]
  File "~/.virtualenvs/plx/lib/python3.9/site-packages/traceml/events/schemas.py", line 449, in to_csv
    self.get_value(dump=True),
  File "~/.virtualenvs/plx/lib/python3.9/site-packages/traceml/events/schemas.py", line 433, in get_value
    return self.chart.to_dict(dump=dump) if dump else self.chart
AttributeError: 'str' object has no attribute 'to_dict'

Expected behavior

The tracking module should raise more informative error, also the tracking module should return an error that can be processed correctly, currently it returns the following error code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant