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

Error in loading data from the DWH in Exercise 2 using Colab #22

Open
nati12 opened this issue Apr 27, 2022 · 2 comments
Open

Error in loading data from the DWH in Exercise 2 using Colab #22

nati12 opened this issue Apr 27, 2022 · 2 comments

Comments

@nati12
Copy link

nati12 commented Apr 27, 2022

Anyone also experienced problems with loading data from the DWH using Colab?

The code:

`conn = sqlite3.connect('data/sakila.db')

df = pd.read_sql('''
SELECT
rental.rental_id, rental.rental_date, rental.return_date,
customer.last_name AS customer_lastname,
store.store_id,
city.city AS rental_store_city,
film.title AS film_title, film.rental_duration AS film_rental_duration,
film.rental_rate AS film_rental_rate, film.replacement_cost AS film_replacement_cost,
film.rating AS film_rating
FROM rental
INNER JOIN customer ON rental.customer_id == customer.customer_id
INNER JOIN inventory ON rental.inventory_id == inventory.inventory_id
INNER JOIN store ON inventory.store_id == store.store_id
INNER JOIN address ON store.address_id == address.address_id
INNER JOIN city ON address.city_id == city.city_id
INNER JOIN film ON inventory.film_id == film.film_id
;
''', conn, index_col='rental_id', parse_dates=['rental_date', 'return_date'])`

The error message:


OperationalError Traceback (most recent call last)
in ()
----> 1 conn = sqlite3.connect('data/sakila.db')
2
3 df = pd.read_sql('''
4 SELECT
5 rental.rental_id, rental.rental_date, rental.return_date,

OperationalError: unable to open database file---------------------------------------------------------------------------

@Alekhyadaspet
Copy link

Alekhyadaspet commented Aug 16, 2022

Yes, same error, while connecting from google colab. I tried with mysqlworkbench desktop app, it throws errors in retrieving specific tables; tried by connecting to drive by uploading db installed on local computer, the codeset presented doesnt work for retrieving tables from db as specified in the course; Also tried few things in connecting sqlite3 api from gcp, I was stuck wondering if it is going to cost.
Tried this code for connecting to drive and mount db to use:
image

Error: OperationalError: (sqlite3.OperationalError) unable to open database file
(Background on this error at: https://sqlalche.me/e/14/e3q8)

Error details:
OperationalError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/sqlalchemy/engine/base.py in _wrap_pool_connect(self, fn, connection)
3360 try:
-> 3361 return fn()
3362 except dialect.dbapi.Error as e:

image

image

@santiagobasulto
Copy link

This is probably related to Google's management of the file system in Colab. I'm leaving this open so people can brainstorm solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants