retrieving call arguments to glyph renderer

Hi,

I’m fairly new to Bokeh but I’m already using it extensively for my work. Currently I’m experimenting with a small library of functions (bokehutils) for adding points etc to the current figure, somewhat akin to how ggplot would do it.
I’m aware that the charts functionality will eventually probably make these functions obsolete, but for now, they work for me and it’s a way of getting to know the package.

My question relates to the following example code:

import pandas as pd
from bokeh.plotting import figure, show
from bokehutils.geom import points
df = pd.DataFrame([[1,2], [2,5], [3,9]], columns=["x", "y"])
f = figure(title="Points", width=400, height=400)
points(f, "x", "y", df)
points(f, "x", "x", df, color="red")
show(f)

When adding points I currently need to add the data source (ColumnDataSource or DataFrame) to each function call. However, I would like to, assuming there is only one
glyph renderer g, retrieve the data source from this renderer (g.data_source) and also the actual rendering call to know what columns (here x="x", y="y") were
actually used in the rendering call. Is there a way of getting this information from a glyph object?

Thanks,

Per