Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gitbase tables don't get types information in SuperSet #306

Open
alexpdp7 opened this issue Sep 2, 2019 · 14 comments
Open

gitbase tables don't get types information in SuperSet #306

alexpdp7 opened this issue Sep 2, 2019 · 14 comments
Labels
blocked This is blocked for some reason bug Something isn't working

Comments

@alexpdp7
Copy link

alexpdp7 commented Sep 2, 2019

When I explore a gitbase table in SuperSet's SQL Lab, columns are reported as NullType:

image

I guess this makes the Chart explorer confused, so it cannot detect "time" columns:

image

, whereas if I do the same on a PostgreSQL metadata table, it works:

image

@smacker
Copy link
Contributor

smacker commented Sep 2, 2019

Most probably related to #34 and #219

As a temporary workaround, you can go to "datasource editor" and change the type manually.

@alexpdp7
Copy link
Author

I just tried updating to v0.24.0-beta3 and the problem persists, I will dig a bit deeper.

@alexpdp7
Copy link
Author

alexpdp7 commented Sep 17, 2019

It seems that the issue is that Gitbase returns the column types as uppercase, while MariaDB returns them as lowercase. If I hack Superset, adding a .lower() to:

https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/dialects/mysql/reflection.py#L190

, types are properly recognized:

image

However, DATETIME columns, while correctly shown in the interface as such, are still not offered as Time Columns for charts.

edit: I think this is because the hack only applies to certain parts of the UI- if I edit the datasource I still get an unknown type. Changing this in Gitbase should work, I think.

@se7entyse7en se7entyse7en self-assigned this Sep 19, 2019
@se7entyse7en
Copy link
Contributor

se7entyse7en commented Sep 19, 2019

I've investigated this and I can confirm what @alexpdp7 said about lowercase. Here's the list of matchable types: https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/dialects/mysql/base.py#L1146

It's also confirmed in this comment in an issue that was opened by @kuba--.

@se7entyse7en
Copy link
Contributor

@ajnavarro WDYT about this? Can the types be lowercased from gitbase?

@se7entyse7en se7entyse7en removed their assignment Sep 25, 2019
@se7entyse7en
Copy link
Contributor

If this is not urgent, maybe this could wait for the migration to gsc and just verify what happens then. wdyt? The problem is that we don't have any eta for gsc migration.

@alexpdp7
Copy link
Author

Yeah, it's not a big deal for me- I'm using Postgres now :-p

So I don't mind this being closed (but it's not my decision- perhaps the issue should be moved to the gitbase repo).

@smacker
Copy link
Contributor

smacker commented Sep 27, 2019

Let's keep it open so people can find it easily and we can track the progress on it. Issue in gitbase: src-d/gitbase#962

@smacker
Copy link
Contributor

smacker commented Oct 1, 2019

it was fixed in gitbase master

@se7entyse7en
Copy link
Contributor

The fix landed in gitbase v0.24.0-rc2.

@alexpdp7
Copy link
Author

I tried that in my dockerless branch and now I get:

sqlalchemy.exc.CompileError: VARCHAR requires a length on dialect mysql

on the logs, perhaps this should be looked into further.

@se7entyse7en
Copy link
Contributor

@alexpdp7 thanks a lot for retesting this!

@smacker
Copy link
Contributor

smacker commented Oct 17, 2019

the issues should be blocked by the new release of gitbase and this issue: src-d/go-mysql-server#844

@se7entyse7en
Copy link
Contributor

The fix landed master, let's wait for the release of new gitbase including the fix.

@se7entyse7en se7entyse7en transferred this issue from src-d/sourced-ce Oct 18, 2019
@se7entyse7en se7entyse7en added blocked This is blocked for some reason bug Something isn't working labels Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This is blocked for some reason bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants