question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot create Google Sheets dataset in Superset

See original GitHub issue

Error adding database from superset with logs below. I’m trying to access the test sheet here https://docs.google.com/spreadsheets/d/1_rN3lm0R_bU3NemO0s9pbFkY5LQPcuy1pscv8ZXPtg8

8-23 18:20:31,398:INFO:shillelagh.adapters.api.gsheets.adapter:GET https://docs.google.com/spreadsheets/d/1_rN3lm0R_bU3NemO0s9pbFkY5LQPcuy1pscv8ZXPtg8/gviz/tq?gid=0&tq=SELECT%20%2A%20LIMIT%201
2021-08-23 18:20:31,400:DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): docs.google.com:443
2021-08-23 18:20:31,604:DEBUG:urllib3.connectionpool:https://docs.google.com:443 "GET /spreadsheets/d/1_rN3lm0R_bU3NemO0s9pbFkY5LQPcuy1pscv8ZXPtg8/gviz/tq?gid=0&tq=SELECT%20%2A%20LIMIT%201 HTTP/1.1" 200 None
2021-08-23 18:20:31,607:DEBUG:shillelagh.adapters.api.gsheets.adapter:Received payload: {'version': '0.6', 'reqId': '0', 'status': 'ok', 'sig': '1453301915', 'table': {'cols': [{'id': 'A', 'label': 'country', 'type': 'string'}, {'id': 'B', 'label': 'cnt', 'type': 'number', 'pattern': 'General'}], 'rows': [{'c': [{'v': 'BR'}, {'v': 1.0, 'f': '1'}]}], 'parsedNumHeaders': 0}}
2021-08-23 18:20:31,619:WARNING:shillelagh.backends.apsw.db:Couldn't load adapter
2021-08-23 18:20:31,621:WARNING:shillelagh.backends.apsw.db:Couldn't load adapter
()
Traceback (most recent call last):
  File "/app/superset/datasets/commands/create.py", line 51, in run
    dataset.fetch_metadata(commit=False)
  File "/app/superset/connectors/sqla/models.py", line 1502, in fetch_metadata
    new_columns = self.external_metadata()
  File "/app/superset/connectors/sqla/models.py", line 666, in external_metadata
    database=self.database, table_name=self.table_name, schema_name=self.schema,
  File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
    raise NoSuchTableError
sqlalchemy.exc.NoSuchTableError: ()
2021-08-23 18:20:31,622:WARNING:superset.datasets.commands.create:()
Traceback (most recent call last):
  File "/app/superset/datasets/commands/create.py", line 51, in run
    dataset.fetch_metadata(commit=False)
  File "/app/superset/connectors/sqla/models.py", line 1502, in fetch_metadata
    new_columns = self.external_metadata()
  File "/app/superset/connectors/sqla/models.py", line 666, in external_metadata
    database=self.database, table_name=self.table_name, schema_name=self.schema,
  File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
    raise NoSuchTableError
sqlalchemy.exc.NoSuchTableError: ()
Error creating model DatasetRestApi: Dataset could not be created.
Traceback (most recent call last):
  File "/app/superset/datasets/commands/create.py", line 51, in run
    dataset.fetch_metadata(commit=False)
  File "/app/superset/connectors/sqla/models.py", line 1502, in fetch_metadata
    new_columns = self.external_metadata()
  File "/app/superset/connectors/sqla/models.py", line 666, in external_metadata
    database=self.database, table_name=self.table_name, schema_name=self.schema,
  File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
    raise NoSuchTableError
sqlalchemy.exc.NoSuchTableError: ()

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/superset/datasets/api.py", line 251, in post
    new_model = CreateDatasetCommand(g.user, item).run()
  File "/app/superset/datasets/commands/create.py", line 65, in run
    raise DatasetCreateFailedError() from ex
superset.datasets.commands.exceptions.DatasetCreateFailedError: Dataset could not be created.
2021-08-23 18:20:31,625:ERROR:superset.datasets.api:Error creating model DatasetRestApi: Dataset could not be created.
Traceback (most recent call last):
  File "/app/superset/datasets/commands/create.py", line 51, in run
    dataset.fetch_metadata(commit=False)
  File "/app/superset/connectors/sqla/models.py", line 1502, in fetch_metadata
    new_columns = self.external_metadata()
  File "/app/superset/connectors/sqla/models.py", line 666, in external_metadata
    database=self.database, table_name=self.table_name, schema_name=self.schema,
  File "/app/superset/connectors/sqla/utils.py", line 47, in get_physical_table_metadata
    raise NoSuchTableError
sqlalchemy.exc.NoSuchTableError: ()

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/superset/datasets/api.py", line 251, in post
    new_model = CreateDatasetCommand(g.user, item).run()
  File "/app/superset/datasets/commands/create.py", line 65, in run
    raise DatasetCreateFailedError() from ex
superset.datasets.commands.exceptions.DatasetCreateFailedError: Dataset could not be created.

I’m building superset from a Dockerfile that looks like this

FROM apache/superset:latest

# Switching to root to install the required packages
USER root

RUN pip install clickhouse-driver==0.2.0
RUN pip install clickhouse-sqlalchemy==0.1.6
RUN pip install shillelagh[gsheetsapi]==1.0.0

# Switching back to using the `superset` user
USER superset

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
RhysDaviscommented, Aug 23, 2021

@betodealmeida 1.0.1 fixes the issue! thank you!

1reaction
betodealmeidacommented, Aug 23, 2021

Oh, I think I hit the same bug in Superset today. I can’t create a dataset using shillelagh as a database. I’ll fix it there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started - Connect Superset To Google Sheets - Preset.io
This tutorial shows you how to connect your local deployment of Apache Superset with Google Sheets, so you can query any publicly available ......
Read more >
Issues adding Google Sheets (gsheets://): Could not connect ...
However, adding gsheets:// as a new Database returns the following error message: An error occurred while creating databases: "Could not connect ...
Read more >
Google Sheets - Apache Superset
There are a few steps involved in connecting Superset to Google Sheets. This tutorial has the most up to date instructions on setting...
Read more >
Analyze your Google Sheets data with Superset in minutes
From Google Sheets toGoogle Analytics,the tools that power your operations create incredibly valuable data—but it's locked up in silos.
Read more >
How to connect Superset to external APIs like Google Analytics?
Superset can't query external data API's directly. Superset has to work with a supported database or data engine ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found