code: def test_timeline():
      df = pd.DataFrame(
          [
              dict(
                  Task="Job A", Start="2009-01-01", Finish="2009-02-28"
              ),
              dict(
                  Task="Job B", Start="2009-03-05", Finish="2009-04-15"
              ),
              dict(
                  Task="Job C", Start="2009-02-20", Finish="2009-05-30"
              ),
          ]
      )
      fig = px.timeline(
          df, x_start="Start", x_end="Finish", y="Task", color="Task"
      )
      assert len(fig.data) == 3
      assert fig.layout.xaxis.type == "date"
      assert fig.layout.xaxis.title.text is None
      fig = px.timeline(
          df,
          x_start="Start",
          x_end="Finish",
          y="Task",
          facet_row="Task",
      )
      assert len(fig.data) == 3
      assert fig.data[1].xaxis == "x2"
      assert fig.layout.xaxis.type == "date"
  
      msg = "Both x_start and x_end are required"
      with pytest.raises(ValueError, match=msg):
          px.timeline(df, x_start="Start", y="Task", color="Task")
  
      msg = "Both x_start and x_end must refer to data convertible to datetimes."
      with pytest.raises(TypeError, match=msg):
          px.timeline(
              df,
              x_start="Start",
              x_end=["a", "b", "c"],
              y="Task",
              color="Task",
          )
  
file_path: plotly.py/packages/python/plotly/plotly/tests/test_optional/test_px/test_px_functions.py
imports: import plotly.express
  import plotly.graph_objects
  from numpy.testing import assert_array_equal
  import numpy
  import pandas
  import pytest
label_desc: Use image node_id 14 for calling a global function with example usage: test_timeline() without return types