guanquann / Stocksera

Finance application that provides more than 60 different alternative data to retail investors
MIT License
639 stars 102 forks source link

error database file #23

Closed nipwd closed 2 years ago

nipwd commented 2 years ago

im getting error in: -database , for some reason dont getting the sentiment column -getiing error on database/indices/snp500_heatmap.csv no such file or directory -EmptyDataError at /senate/ No columns to parse from file

Successfully created/updated database https://www.reddit.com/r/wallstreetbets/comments/rd68ig/daily_discussion_thread_for_december_10_2021/ Empty DataFrame Columns: [prvCls, volume, price, mkt_cap, mentions, sentiment, calls, puts] Index: [] Traceback (most recent call last): File "/GitHub/Stocksera/tasks_to_run.py", line 125, in scrape_stocks_discussion_thread.wsb_change() File "/GitHub/Stocksera/scheduled_tasks/reddit/stocks/scrape_discussion_thread.py", line 231, in wsb_change "WHERE date_updated >= '{}' GROUP BY ticker ORDER BY SUM(mentions) DESC LIMIT 50".format(threshold_hour)) sqlite3.OperationalError: no such column: sentiment

CodeInFilth commented 2 years ago

For this error, which will reoccur for you it seems your files are not all on the same distribution. It is telling you that your sqlite db needs some love and care. Go ahead and open your .db file with your preferred editor and add the column 'sentiment'.

First find the table that is causing the error for you it is wsb_change you can find it under ur line 125 where it states where this is happening _scrape_stocks_discussion_thread.wsb_change()_.

Second find the column you need to insert for this error for this error its sentiment_ at the end of your error sqlite3.OperationalError: no such column: **sentiment**

I would recomend actually using docker, I have adjusted the docker file and told this owner, heres it where yyou can find it, Dockerfile instructions I have tried to send the owner

simply adjust the Dockerfile with what I have supplied and then run these 2 commands and your should have a working server with no issues. (not including any files he didnt include like the IPO files and the WSB Live and Crypto Live scripts)

after you have adjust the tasks_to_run.py file, Dockerfile, added your APIs and added the graph_chart to the static folder and transfered any old database information you have to build on your historical data use the following commands to run the Docker VM and start the turnkey boot.

make sure on your first boot ever to $ python3 manage.py collectstatic

and boot up docker

$      docker-compose build

$      docker-compose up
guanquann commented 2 years ago
nipwd commented 2 years ago

thanks @guanquann i make it run whit no errors, now trying to understand the crypto live section to make it run