MCPcopy Create free account
hub / github.com/sql-machine-learning/sqlflow / Draw

Method Draw

go/codegen/pai/explain_render.go:51–66  ·  view source on GitHub ↗

Draw returns the explain result(png) as HTML

()

Source from the content-addressed store, hash-verified

49
50// Draw returns the explain result(png) as HTML
51func (expn *ExplainRender) Draw() (string, error) {
52 osscli, e := oss.New(expn.endpoint, expn.ak, expn.sk)
53 if e != nil {
54 return "", e
55 }
56 bucket, e := osscli.Bucket(expn.bucket)
57 if e != nil {
58 return "", e
59 }
60 r, e := bucket.GetObject(expn.key)
61 if e != nil {
62 return "", e
63 }
64 defer r.Close()
65 return readAsHTML(r)
66}
67
68func readAsHTML(r io.Reader) (string, error) {
69 body, err := ioutil.ReadAll(r)

Callers 2

ExecuteExplainMethod · 0.80
ExecuteExplainMethod · 0.80

Calls 2

readAsHTMLFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected