-
Notifications
You must be signed in to change notification settings - Fork 9
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
Reading from SQLite ODM2 timeseries #75
Comments
Thanks, @lsetiawan. I'll just add that I've done some similar tests locally with a slightly different version of that LBR SQLite database. My conclusions are generally the same. But I'll try to add more details and more assessments later on. |
@lsetiawan, I have a question about this:
I'm not sure I follow what you're saying here. It's clear that queries on individual tables (like I think the query tests you present are all based on the WOFpy ODM2 time series DAO ( When I run similar queries on the same SQLite database, but using pure |
PR #111 should fix the reading from SQLite for ODM2 Timeseries. Though another error has emerged: Error running Query: (sqlite3.ProgrammingError) SQLite objects created in a thread can only be used in that same thread.The object was created in thread id 140277239318272 and this is thread id 140277247973120 This error occurs when After some googling, I have found some resources that seems promising:
I have a hunch that these problems might be more in the |
@lsetiawan, given the multi-threading problems you're running into (#112), how about going back to the SQLAlchemy-based querying technique that you had already solved for SQLite, which got you past the "join" errors? I remember that was working well with sites, in the notebook tests we worked on together. With all the extensive joining that's needed in WOFpy, it may be that fully using the odm2api query machinery is tricky anyway. |
@ocefpaf A follow up to the SQLite problem, I have another twist. When I'm deploying WOFpy on Ubuntu 16.04, the |
Interesting. I haven't run odm2api on Ubuntu 16.04, so I haven't seen this. Though I'd guess it's not Ubuntu per se, but other things. Given the current Still, what you had figured out before did resolve the "join" errors, didn't it? Or were there things that still weren't working? |
When I run things on Ubuntu 12.04, which is what Travis CI uses, indeed things broke. I also checked the versions of sqlalchemy on both environments, and they are the same.
Things worked great for SQLite, then when I tried the approach on MySQL, the query results differ between the old dao way, and the new way. I accidentally deleted the ipynb that has the new improvements, so i gotta create a new one so I can show you later. Thanks. |
Arrgh. FYI, my old/current laptop is Ubuntu 14.04, so that's where I've done all my testing.
Ah ... Ok. |
Alright, so after some deeper comparison on environments (both conda and os) with Travis CI, it seems like the When creating conda environment without using sqlalchemy: 1.1.5-py27_0 conda-forge
The OS doesn't matter, it seems like the problem here is the older version of @ocefpaf do you think we should pull from conda-forge again? or at lease use the latest |
sounds like progress, @lsetiawan! So, I assume you're saying that with the newer version of sqlalchemy you no longer run into problems with the SQLite ODM2 LBR sample DB, say, on your local computer?? And WOFpy works like a charm with that SQLite DB, locally?? If that's true (let us know), maybe what we (@ocefpaf) should do is create a new |
Just performed Fetching package metadata ...........
Solving package specifications: .
Package plan for installation in environment /root/miniconda/envs/wofpy:
The following packages will be UPDATED:
sqlalchemy: 1.0.17-py27_0 odm2 --> 1.1.7-py27_0 odm2
The following packages will be DOWNGRADED due to dependency conflicts:
spyne: 2.12.14-py27_0 odm2 --> 2.12.11-py27_0 odm2 Seems like there is an updated version on odm2 channel, so I assume |
Updated version of what? I assume you mean
Great. Did you try several of the REST WOFpy 1.0 or 1.1 sample requests, and they all worked fine? Thanks! |
Yes,
Yes. |
Wonderful!! |
When I removed the dependency on the I just tested a fresh environment, |
@lsetiawan it is I am checking to see if there is an updated version of |
Aha! That's the culprit. Nice find 😄 |
PR ODM2/conda-recipes-ODM2#57 should fix that. |
@lsetiawan, we can close this issue, right? |
Yep! All is well on SQLite front regarding this issue. |
WOFPy Testserver deployment
When deploying WOFPy using SQLite database, I am getting errors. For example, when I request
http://127.0.0.1:8080/odm2timeseries/rest/1_1/GetSites
I these errorsFrontend
Backend
The errors also occur when requesting variable info:
http://127.0.0.1:8080/odm2timeseries/rest/1_1/GetVariableInfo
Looking into the problem by using Jupyter notebook
Using jupyter notebook, I looked into this problem further by going through the DAO file functions to see if they work...
I get error similar to the request using WOFpy web interface:
Diving in deeper
I dove in deeper and just querying individual tables to see if there's a fault on the schema or db connection itself.
Sites
I get:
TimeSeriesResults
I get:
TImeSeriesResultValues
I get:
SamplingFeatures
I get:
FeatureActions
I get:
Conclusion so far
Out of the multiple tests that I performed, it seems like the schema is not the problem with WOFPy flask application. But the DAO query itself.. Querying Sites.SamplingFeatureXX works with the odm2python api, but the only Sites does not.. This is the same with TimeSeriesResults, for some reason, it does not recognize the foreign key.
For this testing I'm using the sqlite database located here:
ODM.sqlite
The text was updated successfully, but these errors were encountered: