gophernotes icon indicating copy to clipboard operation
gophernotes copied to clipboard

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

Open MilesLin opened this issue 5 years ago • 5 comments

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:

  • Windows10
  • go version: go1.13.4 windows/amd64

Is that any version problem?

MilesLin avatar Apr 11 '20 12:04 MilesLin

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

microwavestine avatar Apr 14 '20 10:04 microwavestine

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.

oneoneonepig avatar Apr 14 '20 10:04 oneoneonepig

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.

microwavestine avatar Apr 14 '20 11:04 microwavestine

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")

MilesLin avatar Apr 15 '20 13:04 MilesLin

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.

DaruiShi avatar Dec 30 '21 13:12 DaruiShi