gopherdata / gophernotes

The Go kernel for Jupyter notebooks and nteract.
MIT License
3.8k stars 264 forks source link

reflect.Value.Convert: value of type reflect.Value cannot be converted to type series.Type #201

Open MilesLin opened 4 years ago

MilesLin commented 4 years ago

I ran container by docker run -it -p 8888:8888 -v %CD%:/usr/share/notebooks gopherdata/gophernotes:latest-ds. The code below is that I tried to converting a column into a different type, it got an error. image

I found that the go version in the container is go1.11.4.

However, I ran the same code on my local, it works. computer info:

Is that any version problem?

microwavestine commented 4 years ago

If you check the travis.yml file, CI for Go 1.11 version is not there anymore. There's only 1.14, 1.13, 1.12, and it's been updated recently in February. However, The Dockerfile points to building Go 1.11. Maybe try redownloading this source and rewrite part of the Dockerfile to build from 1.13 and start again while this issue is resolved?

language: go

go:
  - 1.14.x
  - 1.13.x
  - 1.12.x
  - master
oneoneonepig commented 4 years ago

If you check the travis.yml file, CI for Go 1.11 version is not there anymore. There's only 1.14, 1.13, 1.12, and it's been updated recently in February. However, The Dockerfile points to building Go 1.11. Maybe try redownloading this source and rewrite part of the Dockerfile to build from 1.13 and start again while this issue is resolved?

language: go

go:
  - 1.14.x
  - 1.13.x
  - 1.12.x
  - master

You won't have to rewrite the Dockerfile, it pulls the latest go package in the alpine repo https://github.com/gopherdata/gophernotes/blob/d8cdc3872a62c94901c7d48d072bb9cb1b5c823f/Dockerfile.DS#L28-L31 Since it was built an year ago, go 1.11 probably was the latest version at that time.

microwavestine commented 4 years ago

I digged into Dockerhub, and @oneoneonepig you are right the docker image was last pushed a year ago, while the latest Dockerfile source on this repo added support for 1.11 version. Looks like you'd have to try building this locally instead of using Docker @MilesLin.

MilesLin commented 4 years ago

I think that is the bug from github.com/kniren/gota which is the package built-in in the container. I created a sample to demonstrate this issue. image

here is the code.

import(
    "github.com/kniren/gota/dataframe"
    "github.com/kniren/gota/series"
)
type TestSt struct {
    Name string
    Score int `dataframe:"Score,int"`
}
data := []TestSt{}
    data = append(data, TestSt{
        Name: "Miles",
        Score: 21,
    })
df := dataframe.LoadStructs(data)
result := series.New(df.Col("Score"), series.Float, "Score")
DaruiShi commented 2 years ago

Yes, @MilesLin I agree with you that the bug is from github.com/kniren/gota package. I came across the same problem with this package. But it works well when I changed to the github.com/go-gota/gota package.

Maybe the docker image tagged by latest:ds should change github.com/kniren/gota to github.com/go-gota/gota.