While using a relative path, I'm getting an error with Sqlite3: OperationalError: unable to open database file,
But with an absolute path it works well. Below are the samples:
#database_filepath = 'Data/DatabaseFile.db'
def load_data(database_filepath):
con = sqlite3.connect(database_filepath) #not working
#con = sqlite3.connect(os.path.abspath(database_filepath)) #working fine
df = pd.read_sql_query('select * from someTable', con)
Is there any better way doing it?